From 93f2e64f3f4f34f78852f6fb8735b4ccab625e3a Mon Sep 17 00:00:00 2001 From: David Lynch Date: Fri, 6 Aug 2021 16:04:23 -0500 Subject: [PATCH] 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 --- includes/Hooks/PageHooks.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/Hooks/PageHooks.php b/includes/Hooks/PageHooks.php index dcfd079cd..7fb1c8320 100644 --- a/includes/Hooks/PageHooks.php +++ b/includes/Hooks/PageHooks.php @@ -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();