Page MenuHomePhabricator

Special:SpecialPages broken on wikis with UploadWizard enabled
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/203001 caused a bug, so now http://commons.wikimedia.beta.wmflabs.org/wiki/Special:SpecialPages is broken and I'm still not quite sure why. SpecialUploadWizard must be messing with SpecialUpload somehow, debugging is necessary.

Not UBN because wmf1 doesn't have this issue, thankfully.

Event Timeline

MarkTraceur claimed this task.
MarkTraceur raised the priority of this task from to High.
MarkTraceur updated the task description. (Show Details)
MarkTraceur subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 204089 had a related patch set uploaded (by MarkTraceur):
Don't set a null context

https://gerrit.wikimedia.org/r/204089

Change 204089 merged by jenkins-bot:
UploadForm: Don't set a null context

https://gerrit.wikimedia.org/r/204089

mediawiki/core is not broken, seems to be an issue in combination with an extension.
SpecialPage::setContext does not care if it get a null, and SpecialPage::getContext will return always a valid value.

@Umherirrender and yet, the patch fixed it - might have been that UW was the only one not passing in a context, but passing null into setContext *was* what was causing the issue.

It is calling ContextSource::setContext from HtmlForm which does not allow a null to be passed.

I was looking at the wrong method. But SpecialUploadWizard should pass a context to avoid use of RequestContext::getMain, but that is another issue.

For reference the fatal:
Catchable fatal error: Argument 1 passed to ContextSource::setContext() must implement interface IContextSource, null given, called in \includes\specials\SpecialUpload.php on line 791 and defined in \includes\context\ContextSource.php on line 56