Page MenuHomePhabricator

Can't open two code blocks in one editor session (aka Uncaught TypeError: Cannot read property 'fail' of null)
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce:

Expected result:
The code editor should be displayed again

Observed result:
Nothing happens

As a nice gimmick, you aren't able to get the save dialog, or the "Switch to source editor", so any of your made edits is lost now :) (Maybe you can cross copy it to another tab where you started VE, but that isn't a good solution :P).

In the browser console you get:
"Uncaught TypeError: Cannot read property 'fail' of null" in ve.ui.MWAceEditorWidget.js:220, which is:

ve.ui.MWAceEditorWidget.prototype.adjustSize = function ( force ) {
	var widget = this;
	// If the editor has loaded, resize events are emitted from #onEditorResize
	// so do nothing here unless this is a user triggered resize, otherwise call the parent method.
	if ( force ) {
		this.loadingPromise.done( function () {
			widget.editor.resize();
		} );
	}
	this.loadingPromise.fail( function () { // <---- Line 220
		// Parent method
		ve.ui.MWAceEditorWidget.super.prototype.adjustSize.call( widget );
	} );
};

Event Timeline

Florian assigned this task to Jdforrester-WMF.
Florian raised the priority of this task from to Needs Triage.
Florian updated the task description. (Show Details)
Florian subscribed.
Florian set Security to None.
Florian added a subscriber: Jdforrester-WMF.

I ran into this when updating docs on mediawiki.org :(

For everyone who want to test it locally: You need to checkout current deployment branch (wmf.7), or go back to commit 718e06c in VE, and you need the CodeEditor extension installed and enabled.

Florian triaged this task as Unbreak Now! priority.Nov 29 2015, 8:43 PM
Florian added a project: CodeEditor.

Change 255946 had a related patch set uploaded (by Florianschmidtwelzow):
AceEditorWidget: Ensure loadingPromise is set when setupEditor runs

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

Change 255946 merged by jenkins-bot:
AceEditorWidget: Ensure loadingPromise is set when setupEditor runs

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

matmarex added a subscriber: Esanders.

@Esanders' patch dbdae59128ebc778890b03ea79d29b8314b59b3a was backported and deployed now.