Skip to content

Commit 1ff2d50

Browse files
Replace wfFindFile (#780)
* replace wfFindFile (w backw support) * sp
1 parent b148377 commit 1ff2d50

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

formats/dygraphs/SRF_Dygraphs.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
use MediaWiki\MediaWikiServices;
23

34
/**
45
* A query printer that uses the dygraphs JavaScript library
@@ -74,7 +75,13 @@ protected function getResultData( SMWQueryResult $result, $outputMode ) {
7475
$aggregatedValues['subject'] = $this->makePageFromTitle( $subject->getTitle() )->getLongHTMLText(
7576
$this->getLinker( $field->getResultSubject() )
7677
);
77-
$aggregatedValues['url'] = wfFindFile( $subject->getTitle() )->getUrl();
78+
if ( method_exists( MediaWikiServices::class, 'getRepoGroup' ) ) {
79+
$aggregatedValues['url'] = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $subject->getTitle() )->getUrl();
80+
} else {
81+
// Before MW 1.34
82+
$aggregatedValues['url'] = wfFindFile( $subject->getTitle() )->getUrl();
83+
}
84+
7885
$dataSource = true;
7986
}
8087

0 commit comments

Comments
 (0)