Page MenuHomePhabricator

Can't open two code blocks in one editor session (aka Uncaught TypeError: Cannot read property 'fail' of null)
Closed, ResolvedPublic1 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 created this task.Nov 29 2015, 2:14 AM
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 added a subscriber: Florian.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptNov 29 2015, 2:14 AM
Florian removed Jdforrester-WMF as the assignee of this task.Nov 29 2015, 2:14 AM
Florian set Security to None.
Florian added a subscriber: Jdforrester-WMF.
jayvdb added a subscriber: jayvdb.Nov 29 2015, 4:01 AM
Nnemo awarded a token.Nov 29 2015, 3:58 PM
Nnemo added a subscriber: Nnemo.

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

Florian claimed this task.Nov 29 2015, 8:43 PM

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 closed this task as Resolved.Dec 1 2015, 12:50 AM
matmarex added a subscriber: Esanders.

@Esanders' patch dbdae59128ebc778890b03ea79d29b8314b59b3a was backported and deployed now.