Page MenuHomePhabricator

TypeError: mw.config.get('wgUploadSourceIds') is null on Special:UploadWizard
Closed, ResolvedPublic


Special:UploadWizard is causing the following error:

Following error appears when loading Special:UploadWizard: at line 312: TypeError: mw.config.get(...) is null

Event Timeline

Restricted Application added a project: Multimedia. · View Herald TranscriptFeb 15 2018, 4:33 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript


  • 3D uses a hook to adds some things to SpecialUpload (for patent)
  • UploadWizard extends from SpecialUpload form, to provide a no-JS fallback
  • UploadWizard overrides all other JS & config, but not the one added in from 3D
  • UploadWizard pulls in the 3D code for Special:Upload
  • Which in turn pulls in the special upload JS
  • But that one is lacking the relevant config to make it work
Ramsey-WMF moved this task from Untriaged to Next up on the Multimedia board.Feb 16 2018, 9:00 PM
Perhelion renamed this task from TypeError: mw.config.get(...) is null on Special:UploadWizard to TypeError: mw.config.get('wgUploadSourceIds') is null on Special:UploadWizard.Feb 18 2018, 7:20 PM

I can confirm this error and rMWe8ca20e84bae causes this error. But why is the module mediawiki.special.upload loaded on Special:UploadWizard without setting the expected JavaScript config variables?

Change 412713 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/3D@master] Don't add JS on Special:UploadWizard

matthiasmullie added a comment.EditedFeb 19 2018, 2:48 PM

rMWe8ca20e84bae didn't really cause the issue.
It's caused by a combination of things:

  • Extension:3D adds a few things (including JavaScript) to Special:Upload
  • Special:UploadWizard extends from Special:Upload (as no-JS fallback), without the relevant (core) JS
  • Which eventually leads to incomplete Special:Upload JS being loaded

(See a more complete reconstruction a few comments earlier: T187461#3976227)

Ideally, UploadWizard would not extend from Special:Upload in this way (or it should be more robust to make sure no other JS can be pulled in), but I've pushed a quick patch that'll prevent Ext:3D from adding the JS in Special:UploadWizard.

Change 412713 merged by jenkins-bot:
[mediawiki/extensions/3D@master] Don't add JS on Special:UploadWizard

matthiasmullie closed this task as Resolved.Mar 26 2018, 4:21 PM