Page MenuHomePhabricator

VisualEditor handling of self-closing XML-style extension tags is buggy (Cannot read property 'slice' of null)
Closed, ResolvedPublic1 Estimate Story Points

Description

Steps to reproduce:

  • create a page with an extension tag for which VisualEditor does not have special logic, and which is self-closing(e.g. <templatestyles src="Foo" />)
  • edit the page in VE
  • click on the extension tag (<> icon) then the Edit button

When the syntax is <templatestyles src="Foo"></templatestyles>, VE offers a generic editing interface where the content and the src parameter can be changed. When the syntax is <templatestyles src="Foo" />, there is no edit box for the content (arguably reasonable behavior), no edit box for the src parameter and the whole interface looks broken, with buttons overlapping the text. Clicking on Done deletes the extension tag. There is also a bunch of extensions (suppressed into notices because they are caught by some kind of generic promise error handler, I think) like

jQuery.Deferred exception: Cannot read property 'slice' of null TypeError: Cannot read property 'slice' of null
jQuery.Deferred exception: Cannot read property 'always' of undefined TypeError: Cannot read property 'always' of undefined

Note also that with non-self-closing style the extension tag is rendered in VE as its parsed output (something like The page Foo has no content in this case), while the self-closing style tag is rendered as an <> icon.

See also:

Details

Related Gerrit Patches:

Event Timeline

Tgr created this task.Oct 1 2017, 9:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 1 2017, 9:48 PM
Tgr renamed this task from VisualEditor handling of self-closing XML-style extension tags is buggy to VisualEditor handling of self-closing XML-style extension tags is buggy (Cannot read property 'slice' of null).Oct 1 2017, 9:51 PM

Change 381788 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] MWExtensionWindow: Always send a string to setValueAndWhitespace

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

Jdforrester-WMF closed this task as Resolved.Oct 2 2017, 5:17 PM
Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptOct 2 2017, 5:17 PM

Change 381788 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] MWExtensionWindow: Always send a string to setValueAndWhitespace

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