When I want to use the special pages Special:OAuthConsumerRegistration and Special:OAuthManageConsumers MediaWiki throws a 'no such special page' error.
Special pages that aren't be defined by 'MWOAuthUISetup::conditionalSetup()' (which all other special pages, because they are defined by 'MWOAuthUISetup::unconditionalSetup()').
I managed to get the two affected special pages work by applying this hacky patch:
diff --git a/OAuth.php b/OAuth.php index 2f5c20a..31e05ca 100644 --- a/OAuth.php +++ b/OAuth.php @@ -45,6 +45,7 @@ MWOAuthSetup::defineSourcePaths( $wgAutoloadClasses, $wgExtensionMessagesFiles, # Setup steps that does not depend on configuration MWOAuthSetup::unconditionalSetup(); MWOAuthUISetup::unconditionalSetup(); +MWOAuthUISetup::conditionalSetup(); MWOAuthAPISetup::unconditionalSetup(); # Actually register special pages and set default $wgMWOAuthCentralWiki @@ -58,5 +59,6 @@ $wgExtensionFunctions[] = function() { // There is actually a central wiki, requiring global user IDs via hook $wgMWOAuthSharedUserIDs = true; } + \MediaWiki\Extensions\OAuth\MWOAuthUISetup::conditionalSetup(); }; diff --git a/frontend/MWOAuthUI.setup.php b/frontend/MWOAuthUI.setup.php index d3aa768..c6ccd10 100644 --- a/frontend/MWOAuthUI.setup.php +++ b/frontend/MWOAuthUI.setup.php @@ -49,7 +49,7 @@ class MWOAuthUISetup { global $wgSpecialPages; global $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActionsHandlers; - if ( MWOAuthUtils::isCentralWiki() ) { + // if ( MWOAuthUtils::isCentralWiki() ) { $wgSpecialPages['OAuthConsumerRegistration'] = 'MediaWiki\Extensions\OAuth\SpecialMWOAuthConsumerRegistration'; $wgSpecialPages['OAuthManageConsumers'] = 'MediaWiki\Extensions\OAuth\SpecialMWOAuthManageConsumers'; @@ -57,6 +57,6 @@ class MWOAuthUISetup { $wgLogNames['mwoauthconsumer'] = 'mwoauthconsumer-consumer-logpage'; $wgLogHeaders['mwoauthconsumer'] = 'mwoauthconsumer-consumer-logpagetext'; $wgLogActionsHandlers['mwoauthconsumer/*'] = 'LogFormatter'; - } + // } } }
I wonder why MWOAuthUISetup::conditionalSetup() needs to be wrapped into a wgExtensionFunctions thing?
Help is welcome! If you need more information please do not hesitate to ask.
OAuth version: 6d6bf97364cb31c7b48d90d3eee42dec582721a3 (REL1_26)
MediaWiki version: 1.26.2
PHP version: 5.6.17-0+deb8u1
MediaWiki Configuration: https://github.com/miraheze/mw-config/blob/master/LocalSettings.php#L1146