Page MenuHomePhabricator

[Regression pre-wmf14] Cannot switch from VE to wikitext editor in Mobile Web
Closed, ResolvedPublic1 Estimate 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

Details

Related Gerrit Patches:
VisualEditor/VisualEditor : wmf/1.25wmf13Remove this.$element on destroy but don't nullify
VisualEditor/VisualEditor : masterRemove this.$element on destroy but don't nullify

Event Timeline

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

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.

Restricted Application added a project: VisualEditor. · View Herald TranscriptDec 18 2014, 6:25 PM
[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 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
Jdforrester-WMF moved this task from Q4 to External and Administrivia on the VisualEditor board.
Jdlrobson closed this task as Resolved.Dec 19 2014, 12:30 AM

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

Cmcmahon reopened this task as Open.Dec 19 2014, 4:05 PM

re-opening, this is still a problem

Esanders closed this task as Resolved.Dec 19 2014, 6:53 PM

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

Verified the fix in Betalabs

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.)

Verified in en.wiki

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptMar 7 2018, 4:33 AM