Replace usage of deprecated PageProps::getInstance()

Bug: T289544
Change-Id: Ib4d86c298508b3dc56c44a4fa7314218f8a0d930
This commit is contained in:
Alexander Vorwerk 2021-09-26 02:37:46 +02:00 committed by Zabe
parent e6c9d3f328
commit b73f4b1a70

View file

@ -15,7 +15,6 @@ use IContextSource;
use MediaWiki\MediaWikiServices;
use MediaWiki\User\UserIdentity;
use OutputPage;
use PageProps;
use RequestContext;
use Title;
@ -179,14 +178,16 @@ class HookUtils {
return false;
}
$props = PageProps::getInstance()->getProperties( $title, 'newsectionlink' );
$services = MediaWikiServices::getInstance();
$props = $services->getPageProps()->getProperties( $title, 'newsectionlink' );
$hasNewSectionLink = isset( $props[ $title->getArticleId() ] );
// Check that the page supports discussions.
// Treat pages with __NEWSECTIONLINK__ as talk pages (T245890)
return $hasNewSectionLink ||
// `wantSignatures` includes talk pages
MediaWikiServices::getInstance()->getNamespaceInfo()->wantSignatures( $title->getNamespace() );
$services->getNamespaceInfo()->wantSignatures( $title->getNamespace() );
// TODO: Consider not loading if forceHideNewSectionLink is true.
}