From 991772e950e41073675b2e81d3f834a7a9c5cfc0 Mon Sep 17 00:00:00 2001 From: D-Groenewegen Date: Wed, 12 Jun 2024 10:05:00 +0200 Subject: [PATCH 1/4] Update MediaPlayer.php No need to support older method. Since SRF 4.0.x (now obsolete), the minimum version is MW 1.35. --- formats/media/MediaPlayer.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/formats/media/MediaPlayer.php b/formats/media/MediaPlayer.php index 58e2b00d..6c41b2e3 100644 --- a/formats/media/MediaPlayer.php +++ b/formats/media/MediaPlayer.php @@ -364,10 +364,6 @@ public function getParamDefinitions( array $definitions ) { * @return bool|File */ private function findFile( Title $title ) { - if ( method_exists( MediaWikiServices::class, 'getRepoGroup' ) ) { - return MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title ); - } - // TODO: Remove when min MW version is 1.34 - return wfFindFile( $title ); + return MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title ); } } From 894fbb7ff0ebebd81c6c205de10d425d4298b83d Mon Sep 17 00:00:00 2001 From: D-Groenewegen Date: Wed, 12 Jun 2024 10:16:49 +0200 Subject: [PATCH 2/4] Update SRF_Dygraphs.php No need to support wfFindFile (MW 1.33 or older). SRF's minimum version is MW 1.34. --- formats/dygraphs/SRF_Dygraphs.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/formats/dygraphs/SRF_Dygraphs.php b/formats/dygraphs/SRF_Dygraphs.php index eb4cbc96..abb5af78 100644 --- a/formats/dygraphs/SRF_Dygraphs.php +++ b/formats/dygraphs/SRF_Dygraphs.php @@ -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; } @@ -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 ) { From 394f5f684a174d3cf9a7a00569e75b3339924f2d Mon Sep 17 00:00:00 2001 From: D-Groenewegen Date: Wed, 12 Jun 2024 10:37:48 +0200 Subject: [PATCH 3/4] Update SRF_Dygraphs.php whitespace --- formats/dygraphs/SRF_Dygraphs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formats/dygraphs/SRF_Dygraphs.php b/formats/dygraphs/SRF_Dygraphs.php index abb5af78..397e1a7b 100644 --- a/formats/dygraphs/SRF_Dygraphs.php +++ b/formats/dygraphs/SRF_Dygraphs.php @@ -109,7 +109,7 @@ protected function getResultData( SMWQueryResult $result, $outputMode ) { $aggregatedValues['subject'] = $this->makePageFromTitle( $title )->getLongHTMLText( $this->getLinker( $field->getResultSubject() ) ); - $aggregatedValues['url'] = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title )->getUrl(); + $aggregatedValues['url'] = MediaWikiServices::getInstance()->getRepoGroup()->findFile( $title )->getUrl(); $dataSource = true; continue; } elseif ( $dataItem->getDIType() == SMWDataItem::TYPE_URI && $this->params['datasource'] === 'url' && !$dataSource ) { From a56bbd1d9fdf6be52fff7235317afa2df6d0462f Mon Sep 17 00:00:00 2001 From: D-Groenewegen Date: Wed, 12 Jun 2024 14:59:37 +0200 Subject: [PATCH 4/4] Update SRF_Calendar.php Replace Language::factory, which has been deprecated since 1.35 (removed by 1.41). --- formats/calendar/SRF_Calendar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/formats/calendar/SRF_Calendar.php b/formats/calendar/SRF_Calendar.php index e05ffe5c..5454ec6d 100644 --- a/formats/calendar/SRF_Calendar.php +++ b/formats/calendar/SRF_Calendar.php @@ -48,7 +48,7 @@ protected function handleParameters( array $params, $outputmode ) { // Store the actual user's language, so we can revert // back to it after printing the calendar. $this->mRealUserLang = clone $wgLang; - $wgLang = Language::factory( trim( $params['lang'] ) ); + $wgLang = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( trim( $params['lang'] ) ); } $this->setColors( $params['colors'] );