Only show the empty state on talk namespaces

This should only affect some edge cases like the project namespace (e.g.
Wikipedia:Village_pump isn't a talk page, but does get discussiontools.)

Bug: T288317
Change-Id: I509101063a1d64d09cff71a84bf48c69ab7a8c08
This commit is contained in:
David Lynch 2021-08-06 16:04:23 -05:00
parent 076242e3b4
commit 93f2e64f3f

View file

@ -201,8 +201,11 @@ class PageHooks implements
}
$context = $article->getContext();
$output = $context->getOutput();
if ( !HookUtils::isFeatureEnabledForOutput( $output, HookUtils::NEWTOPICTOOL ) ) {
// Our empty states are all about using the new topic tool
if ( !HookUtils::isFeatureEnabledForOutput( $output, HookUtils::NEWTOPICTOOL ) || !$title->isTalkPage() ) {
// Our empty states are all about using the new topic tool, but
// expect to be on a talk page, so fall back if it's not
// available or if we're in a non-talk namespace that still has
// DT features enabled
return true;
}
$output->enableOOUI();