mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-17 18:41:01 +00:00
Merge "Allow visualenhancements on pages with __NEWSECTIONLINK__"
This commit is contained in:
commit
2185ac1ca3
|
@ -534,6 +534,10 @@
|
|||
"description": "A list of language codes which will receive an icon in their enhanced reply-button treatment",
|
||||
"merge_strategy": "provide_default"
|
||||
},
|
||||
"DiscussionTools_visualenhancements_newsectionlink_enable": {
|
||||
"value": true,
|
||||
"description": "Enable visual enhancements on non-talk, non-article namespaces if they have __NEWSECTIONLINK__ magic word. Temporary config for phased rollout (T331635)"
|
||||
},
|
||||
"DiscussionToolsEnablePermalinksBackend": {
|
||||
"value": true,
|
||||
"description": "Enable the permalinks backend. Do not enable this unless the database tables exist."
|
||||
|
|
|
@ -352,8 +352,18 @@ class HookUtils {
|
|||
$services = MediaWikiServices::getInstance();
|
||||
|
||||
if ( $feature === static::VISUALENHANCEMENTS ) {
|
||||
// Visual enhancements are only enabled on talk namespaces (T325417)
|
||||
return $title->isTalkPage();
|
||||
$dtConfig = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( 'discussiontools' );
|
||||
// Visual enhancements are only enabled on talk namespaces (T325417) ...
|
||||
return $title->isTalkPage() || (
|
||||
$dtConfig->get( 'DiscussionTools_visualenhancements_newsectionlink_enable' ) &&
|
||||
// ... or __NEWSECTIONLINK__ pages (T331635)
|
||||
static::hasPagePropCached( $title, 'newsectionlink' ) &&
|
||||
// excluding the main namespace, unless it has been configured for signatures
|
||||
(
|
||||
$title->getNamespace() !== NS_MAIN ||
|
||||
$services->getNamespaceInfo()->wantSignatures( $title->getNamespace() )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Check that the page supports discussions.
|
||||
|
|
Loading…
Reference in a new issue