From 1ce810d55cc29ced4370a7fb4319a5d928d3973e Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Fri, 2 Feb 2024 15:23:19 -0500 Subject: [PATCH] Stop using deprecated Hooks::isDisambiguationPage() method This method is being removed from Extension:Disambiguator in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Disambiguator/+/995218 --- includes/HookHandlers/RelatedArticles.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/HookHandlers/RelatedArticles.php b/includes/HookHandlers/RelatedArticles.php index e2aa413..3f7eb9f 100644 --- a/includes/HookHandlers/RelatedArticles.php +++ b/includes/HookHandlers/RelatedArticles.php @@ -39,8 +39,12 @@ public function __construct( Config $config, ILoadBalancer $loadBalancer ) { * @return bool */ private static function isDisambiguationPage( Title $title ) { - return \ExtensionRegistry::getInstance()->isLoaded( 'Disambiguator' ) && - \MediaWiki\Extension\Disambiguator\Hooks::isDisambiguationPage( $title ); + $services = MediaWikiServices::getInstance(); + if ( !$services->hasService( 'DisambiguatorLookup' ) ) { + return false; + } + return $services->getService( 'DisambiguatorLookup' ) + ->isDisambiguationPage( $title ); } /**