Skip to content

Commit

Permalink
Update SRF_Dygraphs.php
Browse files Browse the repository at this point in the history
No need to support wfFindFile (MW 1.33 or older). SRF's minimum version is MW 1.34.
  • Loading branch information
D-Groenewegen authored Jun 12, 2024
1 parent 991772e commit 894fbb7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions formats/dygraphs/SRF_Dygraphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,7 @@ protected function getResultData( SMWQueryResult $result, $outputMode ) {
$aggregatedValues['subject'] = $this->makePageFromTitle( $subject->getTitle() )->getLongHTMLText(
$this->getLinker( $field->getResultSubject() )
);
if ( method_exists( MediaWikiServices::class, 'getRepoGroup' ) ) {
$aggregatedValues['url'] = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $subject->getTitle() )->getUrl();
} else {
// Before MW 1.34
$aggregatedValues['url'] = wfFindFile( $subject->getTitle() )->getUrl();
}

$aggregatedValues['url'] = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $subject->getTitle() )->getUrl();
$dataSource = true;
}

Expand Down Expand Up @@ -115,7 +109,7 @@ protected function getResultData( SMWQueryResult $result, $outputMode ) {
$aggregatedValues['subject'] = $this->makePageFromTitle(
$title
)->getLongHTMLText( $this->getLinker( $field->getResultSubject() ) );
$aggregatedValues['url'] = wfFindFile( $title )->getUrl();
$aggregatedValues['url'] = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title )->getUrl();
$dataSource = true;
continue;
} elseif ( $dataItem->getDIType() == SMWDataItem::TYPE_URI && $this->params['datasource'] === 'url' && !$dataSource ) {
Expand Down

0 comments on commit 894fbb7

Please sign in to comment.