Page MenuHomePhabricator

VisualEditor: Inserting template into slug throws JS error (causing dialogs to break)
Closed, DeclinedPublic

Description

Firefox 22 - Error console.

Tested on Firefox 22 (Monobook) and Chrome 28 (Vector)

Steps to reproduce:

  1. Open the [[Martin J. Silverstein]] in the visual editor.
  2. Click on the empty line between the "Diplomatic posts" and "United States Ambassadors to Uruguay Uruguay" template
  3. Click the "Transclusions" button, add the "Botnets" template and apply the edit.
  4. Try to use any button on the visual toolbar that creates a window, or try to open any existing item that creates a window. This will no longer be possible.

Console log:

  • The added screenshot is the error console as seen in Firefox. On step 3 the "DOM Offset" error is added.
  • On step 4 (And after every subsequent click on an element that creates a window) the "Cannot create a window" error will be added.

Version: unspecified
Severity: normal

Attached:

Firefox_Console.png (249×828 px, 43 KB)

Details

Reference
bz52112

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:53 AM
bzimport set Reference to bz52112.

Relevant error: "Error: Offset could not be translated to a DOM element and offset: 1407"

The inability to open other dialogs is because the error causes the first dialog to never close, and so opening other dialogs fails because VE thinks you've already got a dialog open.

Is this due to adding a transclusion in a slug, perhaps?

Having tested a few more scenario's it would seem that editing near templates in general causes console errors, though none of these seem to cause any lasting issues.

  • Selecting the line mentioned in step 2 and pressing enter will return the console error "TypeError: outermostNode is null"
  • Typing a text under the bottom template of the page and then pressing backpace till the text and that template are gone will cause an error if that edit is undone afterwards:
    • "Error: Range error: Range is no longer valid after DOM mutation "
    • "Error: Offset could not be translated to a DOM element and offset: 1405"

As mentioned before, neither of these errors seem to impact anything in the editor or the edit itself.

Thought we had fixed insertion into slugs in bug 44084 - has this re-surfaced?

This appears to now be fixed - marking as WORKSFORME.