Page MenuHomePhabricator

[Regression pre-wmf14] Cannot switch from VE to wikitext editor in Mobile Web
Closed, ResolvedPublic1 Estimated Story Points

Description

Load VE editor with http://en.m.wikipedia.beta.wmflabs.org/wiki/Headings#/editor/0
Switch to wikitext editor

Switch fails and editor dies with

Regex
All
Errors
Warnings
Info
Logs
Debug
.
load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=20141217T…:150 Exception thrown by user callback
load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=minerva&version=20141217T…:150 TypeError: Cannot read property '0' of null
TypeError: Cannot read property '0' of null {stack: (...), message: "Cannot read property '0' of null"}
2
VM857:9 Uncaught TypeError: Cannot read property '0' of null

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Web-Team-Backlog.
Jdlrobson changed Security from none to None.
Jdlrobson subscribed.

Does the MobileFrontend code for switching back to wikitext attempt to use ve.instances[0] by any chance? If so, try to replace that with target.getSurface(), where target is the instance of ve.init.mw.MobileViewTarget that is created by MF.

[19:37]	edsanders	RoanKattouw, not ve.instances[0]
[19:38]	edsanders	it's in target.unbindHandlers
[19:39]	edsanders	RoanKattouw, tries to call getElementDocument after this.$element has been nulled
[19:39]	edsanders	not sure why this.$element would ever be null though
[19:40]	edsanders	oh, because we set it to null in destroy
[19:40]	edsanders	that seems like a left over from when we generated this.$element

Change 180852 had a related patch set uploaded (by Esanders):
Remove this.$element on destroy but don't nullify

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

Patch-For-Review

Change 180852 merged by jenkins-bot:
Remove this.$element on destroy but don't nullify

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

Jdforrester-WMF renamed this task from Cannot switch from VE to wikitext editor to [Regression pre-wmf14] Cannot switch from VE to wikitext editor.Dec 18 2014, 8:24 PM
Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF moved this task from To Triage to Blocked on the VisualEditor board.
Jdforrester-WMF moved this task from Blocked to FY 18-19 Q3/Q4 on the VisualEditor board.
Jdforrester-WMF renamed this task from [Regression pre-wmf14] Cannot switch from VE to wikitext editor to [Regression pre-wmf14] Cannot switch from VE to wikitext editor in Mobile Web.Dec 18 2014, 8:26 PM

Is it resolved ? I am still getting the following errors in Betalabs:
TypeError: obj is null
Uncaught TypeError: Cannot read property '0' of null

And in test2:
TypeError: this.getSurface(...) is undefined
Uncaught TypeError: Cannot read property 'triggerListener' of undefined

re-opening, this is still a problem

This is fixed but VE hasn't been redeployed yet.

Change 181901 had a related patch set uploaded (by Alex Monk):
Remove this.$element on destroy but don't nullify

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

Patch-For-Review

Change 181901 merged by jenkins-bot:
Remove this.$element on destroy but don't nullify

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

Checked in betalabs - the issue is fixed. However, https://phabricator.wikimedia.org/T85480 - cannot switch from VE to 'Edit source' and back to VE.

(That's T85480. That fix got deployed too, but it seems there's a third bug, T85897.)