From 3e19fce67ab85f1106639a912422fc7676faa86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 20 Aug 2021 18:48:33 +0200 Subject: [PATCH] Load styles in ParserOutput too We load them in OutputPage, because we need that to handle the query parameter 'dtenable=1', but do it here as well just in case the pages are somehow shown without involving OutputPage. Per code review: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/713681/1/includes/Hooks/ParserHooks.php#90 Change-Id: I3f287a9e146de7fd4d37c47dfa47eeb03eeb8cf1 --- includes/Hooks/ParserHooks.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/Hooks/ParserHooks.php b/includes/Hooks/ParserHooks.php index e08bb0e4d..1aaaa67aa 100644 --- a/includes/Hooks/ParserHooks.php +++ b/includes/Hooks/ParserHooks.php @@ -65,6 +65,11 @@ class ParserHooks implements // ParserOption for dtreply was set in onArticleParserOptions if ( $popts->getOption( 'dtreply' ) ) { CommentFormatter::addDiscussionTools( $text ); + // Always load style modules that hide our extra buttons for users who don't have + // DiscussionTools features enabled + $parser->getOutput()->addModuleStyles( [ + 'ext.discussionTools.init.styles', + ] ); } }