MWTransclusionNode.static.toDomElements throwing Object [object Text] has no method 'setAttribute'
Closed, ResolvedPublic

Description

I opened VE and placed my cursor at the bottom of an article.
After adding a "navbox" template through the transclusion editor, the Save button was green (not grayed out), but pressing it did not bring up the save dialog. Making other changes did not help. Tested on current FF and Chrome, Mac OS.

The edit I wanted to make:

https://en.wikipedia.org/w/index.php?title=Waging_Heavy_Peace%3A_A_Hippie_Dream&diff=578220189&oldid=573321038


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=59002

Details

Reference
bz55985

I encountered the same issue with a template added to the bottom of a page, this one on office wiki constructed of other templates. I didn't test

I was using Chrome on Windows 7.

For those with office access, I was trying to add my routine entry to https://office.wikimedia.org/wiki/LCA/Change/Weekly_Staff_Reports

Since I could not save (even when I tried other changes to the page), I wound up doing it manually.

Same on the Italian Wikipedia (when you try to add the equivalent of Template:Sister).

The template I wanted to add is the one highlighted in https://it.wikipedia.org/w/index.php?title=Utente%3AElitre_%28WMF%29%2FSandbox_VE&diff=63505903&oldid=63505798 .

Please notice the switch to wikitext option didn't work as well.
The message asking for confirmation was displayed (twice, the second time with an option to dismiss further questions), but nothing happened.

This bug's symptoms are because it's throwing a fatal JS error (this is why nothing works once the bug happens – you can't save, you can't switch to source mode, you can't do anything).

The bug occurs when the transclusion is converted to Parsoid HTML.

Trace:

Uncaught TypeError: Object [object Text] has no method 'setAttribute'

ve.dm.MWTransclusionNode.js:118
ve.dm.MWTransclusionNode.static.toDomElements ve.dm.MWTransclusionNode.js:118
ve.dm.Converter.getDomElementsFromDataElement ve.dm.Converter.js:340
ve.dm.Converter.getDomSubtreeFromData ve.dm.Converter.js:1461
ve.dm.Converter.getDomSubtreeFromModel ve.dm.Converter.js:1096
ve.dm.Converter.getDomFromModel ve.dm.Converter.js:1078
ve.init.mw.ViewPageTarget.showSaveDialog ve.init.mw.ViewPageTarget.js:1078
ve.init.mw.ViewPageTarget.onToolbarSaveButtonClick ve.init.mw.ViewPageTarget.js:624
oo.EventEmitter.emit oojs.js:593
OO.ui.ButtonWidget.onClick oojs-ui.js:4246

Bug 59002 reflects the issues in comment 1 onwards, but cannot have been the reason for the initial problem (because that code didn't exist in October).

So the rest of this issue is "fixed", but the underlying one isn't, sorry. :-(

Resetting to "normal" priority.

How do you replicate this issue?

Almost certainly fixed by https://gerrit.wikimedia.org/r/#/c/111517/ as we no longer send generated HTML to Parsoid.

Add Comment