mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Replace usage of deprecated PageProps::getInstance()
Bug: T289544 Change-Id: Ib4d86c298508b3dc56c44a4fa7314218f8a0d930
This commit is contained in:
parent
e6c9d3f328
commit
b73f4b1a70
|
@ -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.
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue