Last modified: 2014-10-14 17:37:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68604, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66604 - VisualEditor: Problems changing image type from Thumbnail to Basic when surrounded by images with images in captions
VisualEditor: Problems changing image type from Thumbnail to Basic when surro...
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: Normal normal
: VE-deploy-nextup
Assigned To: Ed Sanders
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-14 00:11 UTC by Rummana Yasmeen
Modified: 2014-10-14 17:37 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Rummana Yasmeen 2014-06-14 00:11:24 UTC
Go to this page:

https://test2.wikipedia.org/w/index.php?title=User:RYasmeen_(WMF)/sandbox&oldid=87309

Change the first image from Thumbnail to Basic and click on "Apply Changes"
The following error appears in the console and cannot save page or cancel editing the page with VE.
 

Uncaught Error: Offset could not be translated to a DOM element and offset: 55
Comment 1 Moriel Schottlender 2014-06-16 17:24:14 UTC
The problem seems to be in ve.ce.Document.prototype.getNodeAndOffset() where the stack ends up empty but the element is not a slug.

I am pretty certain this happens due to the image with the complex caption that includes {{Cite}} <math> <ref> and another image inside it. My attempts to sanitize the wikitext and try everything one-by-one failed when I added that piece: 


[[File:MO-supp-K.svg|thumb]]
[[File:MO-supp-K.svg|thumb]]
[[File:IMA-johnson1.jpg|right|frameless|caption
<ref>{{Cite web|url = http://yahoo.com|title = }}</ref>

<ref>reference</ref>{{Citation needed}}

<math>\pi</math>
[[File:S.M.R.JPG|thumb]]

{{Cite web|url = http://yahoo.com|title = }}

]]
Comment 2 Rummana Yasmeen 2014-06-18 19:23:27 UTC
This is the minimum wikitext required to reproduce this issue:
[[File:MO-supp-K.svg|thumb]]
[[File:IMA-johnson1.jpg|right|frameless|

[[File:S.M.R.JPG|thumb]]
{{Cite web|url = http://yahoo.com|title = }}

]]

You can try on this page:
https://test2.wikipedia.org/wiki/Test66604?veaction=edit
Comment 3 Rummana Yasmeen 2014-06-18 19:46:37 UTC
Found the steps to reproduce it from VE :D

1.Open a page with VE
2.Insert an image, keep it thumbnail-right
3.Go to next line of the added image by pressing enter
4.Add another image on the next line, make it frameless right
5.Now in the caption of the second image : Add another image and go to the next line of this image by pressing enter
6.Add anything on the next line of the caption
7.Apply changes
8.Save Page
7.Reopen the page
8.Try to make the first image Thumbnail to Basic

Observed Result:

Uncaught Error: Offset could not be translated to a DOM element and offset: 55
appears in the console and cannot cancel the edit or save the page in VE
Comment 4 Roan Kattouw 2014-07-02 19:34:44 UTC
I... can no longer reproduce this. I tried the steps in comment 3 as well as the wiki page in comment 2. Maybe this got fixed by Ed's selection-after-deletion fix? Because when we change an image from block to inline, we delete the old image and insert a new one.
Comment 5 James Forrester 2014-07-02 19:49:35 UTC
Marking as theoretically fixed, then. :-)
Comment 6 Ed Sanders 2014-07-03 17:29:20 UTC
On test 2 wiki:
the first case still throws an exception
the second 'minimal' case results in the image being deleted
Comment 7 Ed Sanders 2014-07-03 17:32:29 UTC
first case works perfectly in master
second case still results in the image being deleted
Comment 8 Gerrit Notification Bot 2014-07-03 19:20:12 UTC
Change 144004 had a related patch set uploaded by Esanders:
Skip over nested handlesOwnChildren nodes in getRelativeOffset

https://gerrit.wikimedia.org/r/144004
Comment 9 Gerrit Notification Bot 2014-07-03 20:15:15 UTC
Change 144004 merged by jenkins-bot:
Skip over nested handlesOwnChildren nodes in getRelativeOffset

https://gerrit.wikimedia.org/r/144004
Comment 10 Gerrit Notification Bot 2014-07-10 19:04:59 UTC
Change 144136 had a related patch set uploaded by Esanders:
Fixes to getRelativeOffset and getRelativeRange

https://gerrit.wikimedia.org/r/144136
Comment 11 Gerrit Notification Bot 2014-07-15 17:25:54 UTC
Change 144136 merged by jenkins-bot:
Fixes to getRelativeOffset and getRelativeRange

https://gerrit.wikimedia.org/r/144136
Comment 12 Rummana Yasmeen 2014-07-16 21:39:02 UTC
Now if I follow the minimal wikitext or the steps to reproduce in a page and try to change the first image from thumbnail to Basic, it moves the image inside the caption of the second image.

Is that how we want it now?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links