From 93f8d338c82e905c601de1fc92f0a66507f33cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 14 Feb 2023 00:30:35 +0100 Subject: [PATCH] Disable on LiquidThreads pages Bug: T329423 Change-Id: Id8995e4d35083b740806499c545d1b308a9a1722 --- includes/Hooks/HookUtils.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/Hooks/HookUtils.php b/includes/Hooks/HookUtils.php index 1ada63145..7ac40d6b9 100644 --- a/includes/Hooks/HookUtils.php +++ b/includes/Hooks/HookUtils.php @@ -12,6 +12,7 @@ namespace MediaWiki\Extension\DiscussionTools\Hooks; use ExtensionRegistry; use IContextSource; use IDBAccessObject; +use LqtDispatch; use MediaWiki\Extension\DiscussionTools\CommentUtils; use MediaWiki\Extension\DiscussionTools\ContentThreadItemSet; use MediaWiki\Extension\Gadgets\GadgetRepo; @@ -337,6 +338,11 @@ class HookUtils { if ( $title->getContentModel() !== CONTENT_MODEL_WIKITEXT ) { return false; } + // LiquidThreads needs a separate check, since it predates content models other than wikitext (T329423) + // @phan-suppress-next-line PhanUndeclaredClassMethod + if ( ExtensionRegistry::getInstance()->isLoaded( 'Liquid Threads' ) && LqtDispatch::isLqtPage( $title ) ) { + return false; + } if ( !$title->canExist() ) { return false; }