Something is calling MobileContext::isBlacklistedPageInternal() too early, causing it to read from $wgTitle.
(Not sure which version of MF this is coming from, putting it under stable for now)
Something is calling MobileContext::isBlacklistedPageInternal() too early, causing it to read from $wgTitle.
(Not sure which version of MF this is coming from, putting it under stable for now)
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Set main RequestContext title in api.php | mediawiki/core | master | +4 -0 |
Gonna spike this and put it in our next sprint: https://trello.com/c/L6hhidFo/199-spike-find-out-what-is-calling-mobilecontext-isblacklistedpageinternal-too-early
MobileFrontendHooks::onRequestContextCreateSkin() is the culprit. The RequestContextCreateSkin hook is typically called 3 times on page load. The 3rd call is the one that is breaking. At that time, $wgTitle is set to 'API', but the RequestContext doesn't have an actual title set.
<3 ApiHelp:
#0 /vagrant/mediawiki/extensions/MobileFrontend/includes/MobileContext.php(459): MobileContext->isBlacklistedPageInternal() #1 /vagrant/mediawiki/extensions/MobileFrontend/includes/MobileFrontend.hooks.php(155): MobileContext->isBlacklistedPage() #2 /vagrant/mediawiki/includes/Hooks.php(209): MobileFrontendHooks::onSkinTemplateOutputPageBeforeExec(SkinApi, SkinApiTemplate) #3 /vagrant/mediawiki/includes/skins/SkinTemplate.php(464): Hooks::run(string, array) #4 /vagrant/mediawiki/includes/skins/SkinTemplate.php(230): SkinTemplate->prepareQuickTemplate() #5 /vagrant/mediawiki/includes/OutputPage.php(2261): SkinTemplate->outputPage() #6 /vagrant/mediawiki/includes/api/ApiHelp.php(54): OutputPage->output() #7 /vagrant/mediawiki/includes/api/ApiMain.php(1028): ApiHelp->execute() #8 /vagrant/mediawiki/includes/api/ApiMain.php(397): ApiMain->executeAction() #9 /vagrant/mediawiki/includes/api/ApiMain.php(368): ApiMain->executeActionWithErrorHandling() #10 /vagrant/mediawiki/api.php(84): ApiMain->execute() #11 /var/www/w/api.php(5): include(string) #12 {main}
I'm tempted to just plug this with an entry point check, but instead I would argue that the API just shoudn't execute a crapload of UI code.
Change 196738 had a related patch set uploaded (by Anomie):
Set main RequestContext title in api.php