Enable on all ExtraSignaturesNamespaces

For most Wikimedia wikis, this is Project (Wikipedia) and Help.

Bug: T249036
Change-Id: I535240dc5232b78f11d5003d1141ad8114f01be2
This commit is contained in:
Ed Sanders 2020-04-02 19:16:54 +01:00
parent 3b049210f0
commit 5565c7e4f0

View file

@ -45,8 +45,9 @@ class DiscussionToolsHooks {
* @param Skin $skin The skin that's going to build the UI. * @param Skin $skin The skin that's going to build the UI.
*/ */
public static function onBeforePageDisplay( OutputPage $output, Skin $skin ) { public static function onBeforePageDisplay( OutputPage $output, Skin $skin ) {
$dtConfig = MediaWikiServices::getInstance()->getConfigFactory() $coreConfig = RequestContext::getMain()->getConfig();
->makeConfig( 'discussiontools' ); $services = MediaWikiServices::getInstance();
$dtConfig = $services->getConfigFactory()->makeConfig( 'discussiontools' );
$title = $output->getTitle(); $title = $output->getTitle();
$actionName = Action::getActionName( $output->getContext() ); $actionName = Action::getActionName( $output->getContext() );
$req = $output->getRequest(); $req = $output->getRequest();
@ -64,9 +65,10 @@ class DiscussionToolsHooks {
( (
// Query parameter to load on any wikitext page for testing // Query parameter to load on any wikitext page for testing
$req->getVal( 'dtenable' ) || $req->getVal( 'dtenable' ) ||
// If configured, load on all talk pages // If configured, load on all pages that probably have discussions
( $enabled && ( ( $enabled && (
$title->isTalkPage() || // `wantSignatures` includes talk pages
$services->getNamespaceInfo()->wantSignatures( $title->getNamespace() ) ||
// Treat pages with __NEWSECTIONLINK__ as talk pages (T245890) // Treat pages with __NEWSECTIONLINK__ as talk pages (T245890)
$output->showNewSectionLink() $output->showNewSectionLink()
// TODO: Consider not loading if forceHideNewSectionLink is true. // TODO: Consider not loading if forceHideNewSectionLink is true.