diff --git a/includes/Hooks/HookUtils.php b/includes/Hooks/HookUtils.php index 09d8f0fec..02c166c39 100644 --- a/includes/Hooks/HookUtils.php +++ b/includes/Hooks/HookUtils.php @@ -228,19 +228,26 @@ class HookUtils { } // ?dtenable=1 overrides all user and title checks - if ( - $output->getRequest()->getVal( 'dtenable' ) || + $queryEnable = $output->getRequest()->getVal( 'dtenable' ) || // Extra hack for parses from API, where this parameter isn't passed to derivative requests - RequestContext::getMain()->getRequest()->getVal( 'dtenable' ) - ) { + RequestContext::getMain()->getRequest()->getVal( 'dtenable' ); + // The cookie hack allows users to enable all features when they are not + // yet available on the wiki + $cookieEnable = $output->getRequest()->getCookie( 'discussiontools-tempenable' ) ?: false; + + if ( $feature === self::TOPICSUBSCRIPTION ) { + // Can't be enabled via query/cookie, because the tables may not exist yet (T280082) + $queryEnable = false; + $cookieEnable = false; + } + + if ( $queryEnable ) { return true; } return static::isAvailableForTitle( $title ) && ( static::isFeatureEnabledForUser( $output->getUser(), $feature ) || - // The cookie hack allows users to enable all features when they are not - // yet available on the wiki - $output->getRequest()->getCookie( 'discussiontools-tempenable' ) ?: false + $cookieEnable ); } }