jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/382753 )
Change subject: Revert "Dont register simulate page when not enabled as a BF" ...................................................................... Revert "Dont register simulate page when not enabled as a BF" Conditionally registering a special page based on a user preference breaks the entire preferences system. This reverts commit 4847d76b6601eb5cf231e82916aa4bdfd6e3abd7. Bug: T177524 Change-Id: I51a4f90d266e773cf5057d2d0701187c317e32b5 --- M extension.json M includes/TwoColConflictHooks.php M tests/phpunit/SpecialConflictTestPage/SpecialConflictTestPageIntegrationTest.php 3 files changed, 4 insertions(+), 36 deletions(-) Approvals: WMDE-leszek: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index 3ec4b51..6e465c7 100644 --- a/extension.json +++ b/extension.json @@ -40,9 +40,6 @@ "EditPage::attemptSave:after": [ "TwoColConflictHooks::onAttemptSaveAfter" ], - "SpecialPage_initList": [ - "TwoColConflictHooks::onSpecialPage_initList" - ], "ResourceLoaderTestModules": [ "TwoColConflictHooks::onResourceLoaderTestModules" ] @@ -194,5 +191,8 @@ "ResourceFileModulePaths": { "localBasePath": "", "remoteExtPath": "TwoColConflict" + }, + "SpecialPages": { + "SimulateTwoColEditConflict": "SpecialConflictTestPage" } } diff --git a/includes/TwoColConflictHooks.php b/includes/TwoColConflictHooks.php index c53460b..37fd439 100644 --- a/includes/TwoColConflictHooks.php +++ b/includes/TwoColConflictHooks.php @@ -103,36 +103,4 @@ return true; } - - /** - * @param array &$aSpecialPages - * - * @return bool - */ - public static function onSpecialPage_initList( &$aSpecialPages ) { - if ( defined( 'MW_NO_SESSION' ) ) { - return true; - } - - $user = RequestContext::getMain()->getUser(); - $config = MediaWikiServices::getInstance()->getMainConfig(); - - /** - * If this extension is configured to be a beta feature, and the BetaFeatures extension - * is loaded then require the current user to have the feature enabled. - */ - if ( - $config->get( 'TwoColConflictBetaFeature' ) && - class_exists( BetaFeatures::class ) && - $user instanceof User && - !BetaFeatures::isFeatureEnabled( $user, 'twocolconflict' ) - ) { - return true; - } - - $aSpecialPages['SimulateTwoColEditConflict'] = 'SpecialConflictTestPage'; - - return true; - } - } diff --git a/tests/phpunit/SpecialConflictTestPage/SpecialConflictTestPageIntegrationTest.php b/tests/phpunit/SpecialConflictTestPage/SpecialConflictTestPageIntegrationTest.php index 1df4f36..b5370e8 100644 --- a/tests/phpunit/SpecialConflictTestPage/SpecialConflictTestPageIntegrationTest.php +++ b/tests/phpunit/SpecialConflictTestPage/SpecialConflictTestPageIntegrationTest.php @@ -219,7 +219,7 @@ $this->assertTrue( true ); } - public function testNoPageWhenBetaFeatureAndNoUser() { + public function testNoOutputWhenBetaFeatureAndNoUser() { $this->setMwGlobals( 'wgTwoColConflictBetaFeature', true ); list( $html, $response ) = $this->executeSpecialPage(); -- To view, visit https://gerrit.wikimedia.org/r/382753 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51a4f90d266e773cf5057d2d0701187c317e32b5 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/TwoColConflict Gerrit-Branch: master Gerrit-Owner: Catrope <r...@wikimedia.org> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Andrew-WMDE <andrew.kos...@wikimedia.de> Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de> Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de> Gerrit-Reviewer: WMDE-Fisch <christoph.jau...@wikimedia.de> Gerrit-Reviewer: WMDE-leszek <leszek.mani...@wikimedia.de> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits