Page MenuHomePhabricator

Can't copy and paste a list on office.wiki page in the visual editor
Closed, ResolvedPublic8 Estimated Story Points

Description

Steps to reproduce:

  1. Go to https://office.wikimedia.org/wiki/Community_Liaisons/Editing/Meetings_with_Product
  2. Open the page in the visual editor.
  3. Scroll to the bottom and copy the entire penultimate section.
  4. Scroll to the top and try to paste it as the (new) second section.

Result:

Nothing happens.

Expected result:

The copied section gets pasted into the blank space.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Minimal test case:

A
* B 
** C
* D

Selecting text from B to D (indexes 6-19):

image.png (515×1 px, 69 KB)

… then copying and pasting it after A (index 2), causes an exception:

Uncaught Error: Inserted data is trying to close the root node (at index 9)
    at writeElement (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?11616:1280)
    at VeDmDocument.ve.dm.Document.fixupInsertion (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?11616:1482)
    at VeDmTransactionBuilder.ve.dm.TransactionBuilder.pushInsertion (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionBuilder.js?ccb8f:884)
    at Object.ve.dm.TransactionBuilder.static.newFromInsertion (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.TransactionBuilder.js?ccb8f:56)
    at VeDmSurfaceFragment.ve.dm.SurfaceFragment.insertContent (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.SurfaceFragment.js?7dada:849)
    at VeCeSurface.ve.ce.Surface.afterPasteInsertInternalData (/w/extensions/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js?94ab2:2195)
    at VeCeSurface.ve.ce.Surface.afterPasteAddToFragmentFromInternal (/w/extensions/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js?94ab2:2185)
    at VeCeSurface.ve.ce.Surface.afterPaste (/w/extensions/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js?94ab2:2008)
    at /w/extensions/VisualEditor/lib/ve/src/ce/ve.ce.Surface.js?94ab2:1836

Actually you don't even need nested lists:

* [A 
* B]

fixupInsertion is not happy about the unbalanced range being pasted (specifically the close listItems)

In the past we ran this in a try/catch block, and fell back to a different method if it couldn't be fixed up.

Esanders added a project: Regression.
Esanders added a subscriber: DLynch.

Looks like in the refactor of afterPasteExtractClipboardData we moved the #insertContent call (the one that throws the exception) out of the try/catch block. We should also have had some tests for this...

Esanders raised the priority of this task from High to Unbreak Now!.
Esanders edited projects, added VisualEditor (Current work); removed VisualEditor.

Change 435155 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Fix try/catch in internal paste with original data

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

Change 435155 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Fix try/catch in internal paste with original data

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

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

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

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

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

Change 435292 had a related patch set uploaded (by Jforrester; owner: Esanders):
[VisualEditor/VisualEditor@wmf/1.32.0-wmf.5] Fix try/catch in internal paste with original data

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

Has this fix been deployed? I'd like to get wmf.5 pushed out today if it's possible to get the train back on track.

Mentioned in SAL (#wikimedia-operations) [2018-05-28T19:07:44Z] <twentyafterfour> attempting to get the wmf.5 train back on track. Deploying a fix for T195514 (https://gerrit.wikimedia.org/r/c/435292/) to unblock T191051

Change 435292 merged by 20after4:
[VisualEditor/VisualEditor@wmf/1.32.0-wmf.5] Fix try/catch in internal paste with original data

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

Change 435825 had a related patch set uploaded (by 20after4; owner: 20after4):
[mediawiki/extensions/VisualEditor@wmf/1.32.0-wmf.5] lib/ve submodule bump (gerrit didn't do it automatically...)

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

Mentioned in SAL (#wikimedia-operations) [2018-05-28T20:14:30Z] <twentyafterfour> Test failures on https://gerrit.wikimedia.org/r/#/c/435825/ are preventing deployment of the fix for a critical deployment blocker (see T195514) 1.32.0-wmf.5 still blocked refs T191051

Jdforrester-WMF set the point value for this task to 8.

Change 436049 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@wmf/1.32.0-wmf.5] Update VE core submodule to wmf/1.32.0-wmf.5 HEAD (9032a90ca)

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

Not actually deployed yet.

Change 435825 abandoned by Jforrester:
lib/ve submodule bump (gerrit didn't do it automatically...)

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

Mentioned in SAL (#wikimedia-operations) [2018-05-29T19:16:40Z] <thcipriani> cutting branch for wmf.6, will not deploy wmf.6 as wmf.5 is not currently on group2 as the train is blocked on T195514 which is blocked on T195868 which is blocked on T195906

Change 436049 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@wmf/1.32.0-wmf.5] Update VE core submodule to wmf/1.32.0-wmf.5 HEAD (9032a90ca)

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

Mentioned in SAL (#wikimedia-operations) [2018-05-29T21:06:07Z] <thcipriani@tin> Synchronized php-1.32.0-wmf.5/extensions/VisualEditor/lib/ve: SWAT: [[gerrit:436049|Update VE core submodule to wmf/1.32.0-wmf.5 HEAD (9032a90ca)]] T195514 (duration: 01m 23s)

Jdforrester-WMF removed a project: Patch-For-Review.

Now deployed everywhere.

Vvjjkkii renamed this task from Can't copy and paste a list on office.wiki page in the visual editor to dccaaaaaaa.Jul 1 2018, 1:08 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii removed Esanders as the assignee of this task.
Vvjjkkii lowered the priority of this task from Unbreak Now! to High.
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 dccaaaaaaa to Can't copy and paste a list on office.wiki page in the visual editor.Jul 2 2018, 12:46 PM
CommunityTechBot closed this task as Resolved.
CommunityTechBot assigned this task to Esanders.
CommunityTechBot raised the priority of this task from High to Unbreak Now!.
CommunityTechBot set the point value for this task to 8.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added subscribers: gerritbot, Aklapper.