Enable visual enhancements on all talk namespaces

Bug: T325417
Change-Id: I099a7d03f059f08595dec43ff0205fd5ba765885
This commit is contained in:
Ed Sanders 2023-01-11 18:35:51 +00:00
parent 8c620473fb
commit 5c5073b5ba
2 changed files with 2 additions and 10 deletions

View file

@ -520,10 +520,6 @@
"value": "default",
"description": "Override availability of DiscussionTools visual enhancements. 'default', 'available', or 'unavailable'."
},
"DiscussionTools_visualenhancements_namespaces": {
"value": [ 1, 3 ],
"description": "Namespaces on which visual enhancements are available. Array of namespaces IDs (numbers), or `true` to enable on all namespaces/pages which have DiscussionTools."
},
"DiscussionTools_visualenhancements_pageframe": {
"value": "default",
"description": "Override availability of DiscussionTools visual enhancements's page frame sub-feature. 'default', 'available', or 'unavailable'."

View file

@ -330,12 +330,8 @@ class HookUtils {
$services = MediaWikiServices::getInstance();
if ( $feature === static::VISUALENHANCEMENTS ) {
$dtConfig = $services->getConfigFactory()->makeConfig( 'discussiontools' );
$namespaces = $dtConfig->get( 'DiscussionTools_visualenhancements_namespaces' );
if ( is_array( $namespaces ) ) {
// Only allow visual enhancements in specified namespaces
return in_array( $title->getNamespace(), $namespaces, true );
}
// Visual enhancements are only enabled on talk namespaces (T325417)
return $title->isTalkPage();
}
$hasNewSectionLink = static::hasPagePropCached( $title, 'newsectionlink' );