Page MenuHomePhabricator

References disappear when dragging and dropping them using VisualEditor
Closed, DuplicatePublicBUG REPORT

Description

Steps to Reproduce:

  • Edit an article using VisualEditor.
  • Drag and drop an existing reference.

Actual Results:

  • The reference disappears, throwing the below error in the console.

Expected Results:

  • The reference is moved to the new spot.

This happens after 1.34.0-wmf.24, and only with an existing reference: a newly created one can be dragged just fine. As a workaround, cutting and pasting a reference still works.


load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:140 Uncaught Error: Expected [{"type":"mwReference","attributes":{"listIndex":2,"listGroup":"mwReference/","listKey":"auto/2","refGroup":"","refListItemId":"mw-reference-text-cite_note-3"}},{"type":"/mwReference"}] but got [{"type":"mwReference","attributes":{"mw":{"name":"ref","attrs":{},"body":{"id":"mw-reference-text-cite_note-3"}},"listIndex":2,"listGroup":"mwReference/","listKey":"auto/2","refGroup":"","contentsUsed":true,"refListItemId":"mw-reference-text-cite_note-3"}},{"type":"/mwReference"}]
    at checkEqual (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:140)
    at Object.ve.dm.TreeModifier.static.applyTreeOperation (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:140)
    at Object.ve.dm.TreeModifier.static.applyTreeOperations (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:136)
    at VeDmTreeModifier.ve.dm.TreeModifier.process (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:142)
    at VeDmTransactionProcessor.ve.dm.TransactionProcessor.process (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:88)
    at VeDmDocument.ve.dm.Document.commit (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:209)
    at VeDmSurface.ve.dm.Surface.changeInternal (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:170)
    at VeDmSurface.ve.dm.Surface.change (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:170)
    at VeDmSurfaceFragment.ve.dm.SurfaceFragment.change (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:180)
    at VeDmSurfaceFragment.ve.dm.SurfaceFragment.removeContent (load.php?lang=en&modules=ext.visualEditor.core&skin=vector&version=1r5uf:192)

Event Timeline

Probably due to r537710, which in turns brings r537652 in.

Should also mention that this totally breaks the editor, at least it did for me.

Tried to cut a paragraph containing citations, and it failed to cut most of it, and some buttons and functions would not work after this (such as Publish changes or Undo). This was the same behaviour as the vanishing reference, which also vanished when cut (not just "dragged" as the original post suggests). I could no longer Undo or click Publish changes. I'd say this is a very urgent issue to fix.

Should also mention that this totally breaks the editor, at least it did for me.

Tried to cut a paragraph containing citations, and it failed to cut most of it, and some buttons and functions would not work after this (such as Publish changes or Undo). This was the same behaviour as the vanishing reference, which also vanished when cut (not just "dragged" as the original post suggests). I could no longer Undo or click Publish changes. I'd say this is a very urgent issue to fix.

Cutting a single citation (just click on it and ctrl+x, ctrl+v) still works for me, but you're right about cutting a paragraph containing citations breaking the editor. Moreover, "Publish changes" is grayed out even if you drag and drop a citation as your first action, as reported on itwiki by @Emanuele676.

The problem is still there and as said above, it breaks the editor for some contributors.

ppelberg triaged this task as Unbreak Now! priority.Oct 2 2019, 9:43 PM

Change 541088 had a related patch set uploaded (by Divec; owner: Divec):
[VisualEditor/VisualEditor@master] TreeModifier: Ignore more attributes when validating linear data

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