Page MenuHomePhabricator

Pasting in an link from Google-translated content throws an exception
Closed, ResolvedPublic

Description

Translate a page using the Google Translate plugin for Chrome.

Select some text with a link and paste it into VE:

Uncaught Error: Annotation with hash h1ca51001cb55aefd not found in store
    at new VeDmAnnotationSet (load.php
    at VeDmElementLinearData.ve.dm.ElementLinearData.getAnnotationsFromOffset (load.php
    at VeDmElementLinearData.ve.dm.ElementLinearData.sanitize (load.php
    at VeCeSurface.ve.ce.Surface.afterPasteSanitize (load.php
    at VeCeSurface.ve.ce.Surface.afterPasteAddToFragmentFromExternal (load.php
    at VeCeSurface.ve.ce.Surface.afterPaste (load.php
    at load.php

The pasted HTML is:

<font style="color: rgb(34, 34, 34); font-size: 14px; background-color: rgb(255, 255, 255); vertical-align: inherit;"><font style="vertical-align: inherit;">&nbsp;movie&nbsp;</font></font><i style="color: rgb(34, 34, 34); font-size: 14px; background-color: rgb(255, 255, 255);"><a href="https://no.wikipedia.org/wiki/Natt_til_17." title="Night to 17." style="text-decoration-line: none; color: rgb(11, 0, 128); background: none;"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Night to 17</font></font></a></i><font style="color: rgb(34, 34, 34); font-size: 14px; background-color: rgb(255, 255, 255); vertical-align: inherit;"><font style="vertical-align: inherit;">&nbsp;in 2013</font></font>

Event Timeline

Esanders renamed this task from Pasting in an link throws an exception to Pasting in an link from Google-translated content throws an exception.Feb 10 2019, 10:58 PM
Esanders edited projects, added VisualEditor; removed ContentTranslation.

Change 489673 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Convert if-block to while-block for repeated annotations

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

Change 489673 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Convert if-block to while-block for repeated annotations

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

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

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

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

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

Question for group!

I am trying to verify this fix, and so far I find that I can paste Google-translated text (with link/s) into VE without generating errors.
However, is there any expectation that the links will be preserved? Because that is not happening. Links within the copied text revert to plain text when pasted into VE-- and that's true whether or not the pasted text is Google-translated.

However, is there any expectation that the links will be preserved? Because that is not happening. Links within the copied text revert to plain text when pasted into VE-- and that's true whether or not the pasted text is Google-translated.

It is a known behavior, see T129546: Support preserving external links in pasted HTML content and related tasks – but whether it is a bug or a feature is debatable ;)

Barbvd moved this task from QA to Product owner review on the VisualEditor (Current work) board.

Okay, @matmarex -- thanks for that background! : )

Am going to go ahead and verify.

ppelberg claimed this task.