Skip to content

Commit

Permalink
Stop using deprecated Hooks::isDisambiguationPage() method
Browse files Browse the repository at this point in the history
This method is being removed from Extension:Disambiguator in
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Disambiguator/+/995218
  • Loading branch information
cscott committed Feb 2, 2024
1 parent 64e6724 commit 1ce810d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions includes/HookHandlers/RelatedArticles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down

0 comments on commit 1ce810d

Please sign in to comment.