Page MenuHomePhabricator

OOjs-UI raises 'Error: Widget not found: undefined' on c:Special:Upload
Closed, ResolvedPublic

Description

Reported on https://commons.wikimedia.org/wiki/Commons:Village_pump#Do_we_have_a_technical_problem_in_the_upload_form.3F

Go to https://commons.wikimedia.org/wiki/Special:Upload?debug=true

Get:

Uncaught Error: Widget not found: undefined
    at Object.OO.ui.Element.static.unsafeInfuse (oojs-ui-core.js?ece99:695)
    at Object.OO.ui.Element.static.infuse (oojs-ui-core.js?ece99:662)
    at Object.OO.ui.infuse (oojs-ui-core.js?ece99:340)
    at HTMLDocument.<anonymous> (mediawiki.action.edit.js?29a7f:23)
    at fire (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=modern&version=0ynbgde:3148)
    at Object.fireWith [as resolveWith] (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=modern&version=0ynbgde:3260)
    at Function.ready (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=modern&version=0ynbgde:3472)
    at completed (load.php?debug=true&lang=en&modules=jquery%2Cmediawiki|mediawiki.legacy.wikibits&only=scripts&skin=modern&version=0ynbgde:3503)

That code is:

OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) {
	// look for a cached result of a previous infusion.
	var id, $elem, data, cls, parts, parent, obj, top, state, infusedChildren;
	if ( typeof idOrNode === 'string' ) {
		id = idOrNode;
		$elem = $( document.getElementById( id ) );
	} else {
		$elem = $( idOrNode );
		id = $elem.attr( 'id' );
	}
	if ( !$elem.length ) {
		throw new Error( 'Widget not found: ' + id );
	}

Traceback:
mediawiki.action.edit.js#L23 <anonymous>: wpSummary = OO.ui.infuse( $( '#wpSummaryWidget' ) );
oojs-ui-core.js#L340 infuse: return OO.ui.Element.static.infuse( idOrNode );
oojs-ui-core.js#L662 infuse: var obj = OO.ui.Element.static.unsafeInfuse( idOrNode, false );
oojs-ui-core.js#L695 unsafeInfuse: throw new Error( 'Widget not found: ' + id );

$( '#wpSummaryWidget' ) is of length 0 on Special:Upload

Event Timeline

Aklapper created this task.Sep 4 2017, 1:45 PM
zhuyifei1999 renamed this task from "Uncaught Error: Widget not found: undefined" for unsafeInfuse on c:Special:Upload to OOjs-UI raises 'Error: Widget not found: undefined' on c:Special:Upload.Sep 4 2017, 1:52 PM
zhuyifei1999 updated the task description. (Show Details)

Change 375826 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] SpecialUpload: Stop loading 'mediawiki.action.edit'

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

Change 375827 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[oojs/ui@master] Element: Improve error message when the widget being infused is missing

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

matmarex claimed this task.Sep 4 2017, 4:07 PM

Change 375827 merged by jenkins-bot:
[oojs/ui@master] Element: Improve error message when the widget being infused is missing

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

Change 375826 merged by jenkins-bot:
[mediawiki/core@master] SpecialUpload: Stop loading 'mediawiki.action.edit'

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

matmarex edited projects, added MediaWiki-Uploading; removed MediaWiki-Special-pages.
Restricted Application added a project: Multimedia. · View Herald TranscriptSep 4 2017, 5:40 PM
matmarex closed this task as Resolved.Sep 5 2017, 4:56 PM
matmarex removed a project: Patch-For-Review.