Jdlrobson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/335864 )
Change subject: Allow more control for skins should show Related pages as beta feature ...................................................................... Allow more control for skins should show Related pages as beta feature * Remove minerva specific hack * Make config a little less confusing One side effect of this is that RelatedPages on minerva will also follow the user preference for beta features and will not follow the MobileFrontend model (which should be fine provided we don't want to put this in beta again!) Bug: T146436 Change-Id: Ifd7e9dc92ede6e8f3b2f115adbe9dd5bb341049b --- M extension.json M includes/FooterHooks.php 2 files changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RelatedArticles refs/changes/64/335864/1 diff --git a/extension.json b/extension.json index 7aff868..fdffbd5 100644 --- a/extension.json +++ b/extension.json @@ -99,7 +99,9 @@ "RelatedArticlesOnlyUseCirrusSearch": false, "RelatedArticlesLoggingSamplingRate": 0.01, "RelatedArticlesEnabledSamplingRate": 1, - "@RelatedArticlesFooterBlacklistedSkins": "List of skin names (e.g. 'minerva') where related articles won't be shown in the footer. If absent related articles will show in stable on Minerva or beta on all other skins.", + "@RelatedArticlesDesktopBetaFeatureSkins": "List of skins for which related pages won't be shown in the footer unless the user has opted into the beta feature. BetaFeatures must be installed to support this.", + "RelatedArticlesBetaFeatureSkins": [ "vector", "monobook", "modern", "cologne-blue" ], + "@RelatedArticlesFooterBlacklistedSkins": "List of skin names (e.g. 'minerva') where related articles won't be shown in the footer. If empty and no BetaFeatures RelatedArticles will be installed on all skins.", "RelatedArticlesFooterBlacklistedSkins": [] }, "ConfigRegistry": { diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php index 191b943..1be58cc 100644 --- a/includes/FooterHooks.php +++ b/includes/FooterHooks.php @@ -82,13 +82,14 @@ $blacklistedSkins = $config->get( 'RelatedArticlesFooterBlacklistedSkins' ); $skinName = $skin->getSkinName(); $isBlacklistedSkin = in_array( $skinName, $blacklistedSkins ); + $isBetaFeatureSkin = in_array( $skinName, $config->get( 'RelatedArticlesBetaFeatureSkins' ) ); if ( !$isBlacklistedSkin ) { - // Minerva has its own beta mode and doesn't use the BetaFeatures extension. - if ( $skinName === 'minerva' ) { + if ( $isBetaFeatureSkin ) { + return !class_exists( 'BetaFeatures' ) || BetaFeatures::isFeatureEnabled( $user, 'read-more' ); + } else { return true; } - return !class_exists( 'BetaFeatures' ) || BetaFeatures::isFeatureEnabled( $user, 'read-more' ); } return false; -- To view, visit https://gerrit.wikimedia.org/r/335864 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd7e9dc92ede6e8f3b2f115adbe9dd5bb341049b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/RelatedArticles Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits