Page MenuHomePhabricator

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

Description

Special:UploadWizard is causing the following error:

Following error appears when loading Special:UploadWizard:

https://commons.wikimedia.org/w/load.php?debug=false&lang=en&modules=ext.3d%2CeventLogging%2CnavigationTiming%2CwikimediaEvents%7Cext.3d.special.upload%7Cext.centralNotice.geoIP%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.echo.api%2Cinit%7Cext.eventLogging.subscriber%7Cext.uls.common%2Ccompactlinks%2Ceventlogger%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.uploadWizard.jquery.arrowSteps%7Cext.visualEditor.desktopArticleTarget.init%7Cext.visualEditor.supportCheck%2CtargetLoader%2CtempWikitextEditorWidget%2Ctrack%2Cve%7Cext.wikimediaEvents.loggedin%7Cjquery.accessKeyLabel%2CbyteLength%2CbyteLimit%2CcheckboxShiftClick%2Cclient%2Ccookie%2CgetAttrs%2ChighlightText%2CmakeCollapsible%2Cmw-jump%2Cspinner%2Csuggestions%2CtabIndex%2CtextSelection%2Cthrottle-debounce%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CRegExp%2CTitle%2CUri%2Capi%2Ccldr%2CconfirmCloseWindow%2Ccookie%2Cexperiments%2Cfeedback%2Chtmlform%2Cicon%2CjqueryMsg%2Clanguage%2CmessagePoster%2Cnotify%2CsearchSuggest%2Cstorage%2Ctemplate%2Cuser%2Cutil%7Cmediawiki.ForeignApi.core%7Cmediawiki.api.edit%2Cmessages%2Coptions%2Cparse%2Cuser%7Cmediawiki.editfont.styles%7Cmediawiki.language.data%2Cinit%7Cmediawiki.legacy.wikibits%7Cmediawiki.libs.jpegmeta%2Cpluralruleparser%7Cmediawiki.page.ready%2Cstartup%7Cmediawiki.special.upload%7Cmediawiki.template.regexp%7Cmediawiki.ui.button%2Cicon%7Cmediawiki.widgets.CategoryMultiselectWidget%2CDateInputWidget%7Cmediawiki.widgets.DateInputWidget.styles%7Cmmv.bootstrap%2Chead%7Cmmv.bootstrap.autostart%7Cmoment%2Coojs%2Coojs-ui%2Coojs-ui-core%2Coojs-ui-toolbars%2Coojs-ui-widgets%2Coojs-ui-windows%2Csite%7Coojs-ui-core.styles%7Coojs-ui.styles.icons-alerts%2Cicons-content%2Cicons-editing-advanced%2Cicons-editing-core%2Cicons-interactions%2Cicons-location%2Cicons-moderation%2Cicons-movement%2Cindicators%2Ctextures%7Cschema.UniversalLanguageSelector%7Cskins.vector.js%7Cuser.defaults&skin=vector&version=0h9kyrk 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

So...

  • 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

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

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

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

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