From 888d554ecfbc0f22708bad228fa96eb02cc95e2f Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Fri, 16 Apr 2021 13:29:09 +0100 Subject: [PATCH] Don't split parser cache when reply tool is enabled by default Bug: T279864 Change-Id: I16f1546e1373311563b8a90d6a025b0b45ffb793 --- includes/Hooks/ParserHooks.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/includes/Hooks/ParserHooks.php b/includes/Hooks/ParserHooks.php index d06def28b..9570f5556 100644 --- a/includes/Hooks/ParserHooks.php +++ b/includes/Hooks/ParserHooks.php @@ -48,8 +48,13 @@ class ParserHooks implements if ( $dtConfig->get( 'DiscussionToolsUseParserCache' ) && - HookUtils::isAvailableForTitle( $article->getTitle() ) && - HookUtils::isFeatureEnabledForUser( $popts->getUser(), HookUtils::REPLYTOOL ) + HookUtils::isAvailableForTitle( $article->getTitle() ) && ( + // If the reply tool is enabled by default, always apply the DOM transform + // TODO: Check any feature in CommentFormatter::USE_WITH_FEATURES + $dtConfig->get( 'DiscussionTools_' . HookUtils::REPLYTOOL ) === 'available' || + // ...or if enabled for a specific user + HookUtils::isFeatureEnabledForUser( $popts->getUser(), HookUtils::REPLYTOOL ) + ) ) { $popts->setOption( 'dtreply', true ); }