Page MenuHomePhabricator

Console error when copy/pasting wikitext into VE
Closed, ResolvedPublic1 Story Points

Description

I just tried to copy/paste this wikitext into VE on beta:

Mapframes with a width of 100% fail to display on the mobile site unless "frameless" is used
<mapframe width="100%" height="400" latitude="47" longitude="7.5" zoom="8" text="Captions do appear" />

{{-}}
With frameless:
<mapframe width="100%" height="400" latitude="47" longitude="7.5" zoom="8" frameless />

The content rendered, but it broke on the code and console errors appeared Uncaught TypeError: Cannot read property '$element' of null for ve.ce.FocusableNode.updateInvisibleIcon

Full console log:

Uncaught TypeError: Cannot read property '$element' of null
    at load.php?...:47295
(anonymous) @ load.php?...:47295
requestAnimationFrame (async)
ve.ce.FocusableNode.updateInvisibleIcon @ load.php?...:47292
ve.ce.FocusableNode.onFocusableSetup @ load.php?...:47278
oo.EventEmitter.emit @ VM488:159
ve.ce.View.setLive @ load.php?...:46364
ve.ce.BranchNode.onSplice @ load.php?...:46644
oo.EventEmitter.emit @ VM488:159
ve.dm.BranchNode.splice @ load.php?...:36064
ve.dm.TreeModifier.insertNode @ load.php?...:38786
ve.dm.TreeModifier.create @ load.php?...:39012
ve.dm.TreeModifier.processInsert @ load.php?...:38895
ve.dm.TreeModifier.processOperation @ load.php?...:38641
ve.dm.TreeModifier.process @ load.php?...:38606
ve.dm.TransactionProcessor.process @ load.php?...:36813
ve.dm.Document.commit @ load.php?...:40913
ve.dm.Surface.changeInternal @ load.php?...:39544
ve.dm.Surface.change @ load.php?...:39525
ve.dm.SurfaceFragment.change @ load.php?...:39898
ve.dm.SurfaceFragment.insertDocument @ load.php?...:40324
insert @ load.php?...:49401
fire @ load.php?...:46
fireWith @ load.php?...:47
deferred.(anonymous function) @ load.php?...:51
ve.ui.DataTransferHandler.resolve @ load.php?...:55027
(anonymous) @ load.php?...:65005
mightThrow @ load.php?...:49
process @ load.php?...:50
setTimeout (async)
(anonymous) @ load.php?...:50
fire @ load.php?...:46
fireWith @ load.php?...:47
fire @ load.php?...:47
fire @ load.php?...:46
fireWith @ load.php?...:47
deferred.(anonymous function) @ load.php?...:51
(anonymous) @ VM488:28
fire @ load.php?...:46
fireWith @ load.php?...:47
done @ load.php?...:126
(anonymous) @ load.php?...:129
load (async)
send @ load.php?...:129
ajax @ load.php?...:125
jQuery.ajax @ load.php?...:143
ajax @ VM488:27
post @ VM488:26
ve.init.mw.Target.parseWikitextFragment @ load.php?...:63907
ve.ui.MWWikitextStringTransferHandler.process @ load.php?...:64974
ve.ui.DataTransferHandler.getInsertableData @ load.php?...:55022
ve.ce.Surface.handleDataTransferItems @ load.php?...:49412
ve.ce.Surface.afterPasteInsertExternalData @ load.php?...:49256
ve.ce.Surface.afterPasteAddToFragmentFromExternal @ load.php?...:49248
ve.ce.Surface.afterPaste @ load.php?...:49055
(anonymous) @ load.php?...:48955
setTimeout (async)
ve.ce.Surface.onPaste @ load.php?...:48951
dispatch @ load.php?...:69
elemData.handle @ load.php?...:66

Details

Related Gerrit Patches:
mediawiki/extensions/VisualEditor : masterUpdate VE core submodule to master (3cb400800)
VisualEditor/VisualEditor : masterFocusableNode: Move getModel teardown check to updateInvisibleIconSync
mediawiki/extensions/VisualEditor : masterMWTransclusionNode: Remove old createInvisibleIcon override

Event Timeline

Mooeypoo created this task.Jun 5 2018, 4:54 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJun 5 2018, 4:54 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@Esanders Could be a side effect of 49a8fbae4 or 24e35e428... but it seems to be saying that node is null, which is weird since node = this. Or this.icon is null, in a path which has already verified it exists.

Esanders updated the task description. (Show Details)Jun 5 2018, 5:26 PM

Change 437519 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] FocusableNode: Move getModel teardown check to updateInvisibleIconSync

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

... Or this.icon is null, in a path which has already verified it exists.

It is, because it never gets created as the teardown this.getModel() check fails in createInvisibleIcon.

Change 437520 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] MWTransclusionNode: Remove old createInvisibleIcon override

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

^ This second patch fixes a similar issue in template nodes with a different cause (old override not removed).

Deskana assigned this task to Esanders.Jun 5 2018, 6:36 PM
Deskana triaged this task as High priority.
Deskana edited projects, added VisualEditor (Current work); removed VisualEditor.
Deskana moved this task from Incoming to Code review on the VisualEditor (Current work) board.

Change 437520 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWTransclusionNode: Remove old createInvisibleIcon override

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

Change 437519 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] FocusableNode: Move getModel teardown check to updateInvisibleIconSync

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

Change 438041 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (e333fe327)

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

Change 438041 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3cb400800)

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

Deskana closed this task as Resolved.Jun 11 2018, 3:04 PM

Well the content still does not load because of this error: GET https://maps-beta.wmflabs.org/img/osm-intl,8,47,7.5,1000x1000.jpeg?lang=en 400 ()

But that "Uncaught TypeError: Cannot read property '$element' of null" is not appearing anymore at least. So I will mark it verified.

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 13 2018, 4:07 AM

The 400 is specifically "Unknown source".

Deskana added subscribers: SBisson, Catrope, Deskana.

That issue with the content not loading looks like an issue with the maps service, not the visual editor. The maps test infrastructure is notably unreliable, so I highly doubt that the failure means anything, but I'll add the relevant maps tags just in case. @Catrope, @Mooeypoo, @SBisson may want to take a look at this to verify that it is indeed nothing to be concerned about.

(Perhaps I should only have put the Collaboration-Team-Triage project on? Sorry if I did it wrong.)

Jdforrester-WMF set the point value for this task to 1.Jun 13 2018, 6:25 PM
Vvjjkkii renamed this task from Console error when copy/pasting wikitext into VE to klbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Esanders as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed the point value for this task.
Vvjjkkii removed subscribers: gerritbot, Aklapper.
CommunityTechBot renamed this task from klbaaaaaaa to Console error when copy/pasting wikitext into VE.Jul 2 2018, 9:23 AM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Esanders.
CommunityTechBot set the point value for this task to 1.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.