Opened 4 years ago

Closed 4 years ago

#11813 closed Bug (fixed)

[Image2] Link is lost when copy&paste captioned image or undo + duplicated resize handle

Reported by: Piotrek Koszuliński Owned by: Olek Nowodziński
Priority: Normal Milestone: CKEditor 4.4.1
Component: General Version: 4.4.0
Keywords: Cc:

Description

  1. Open image2 sample.
  2. Link the image.
  3. Copy and paste it.

Result:

  • All browsers - there's no link physically. Context menu says that it can be edited, but only because it was preserved in widget's data object.
  • IEs (checked IE11) - there are two resize handles.

Change History (8)

comment:1 Changed 4 years ago by Piotrek Koszuliński

Link is also lost when undoing/redoing, what means that it's lost on widget initialization.

comment:2 Changed 4 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4.1
Status: newconfirmed

The bug is in this line: https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/image2/plugin.js#L377

getFirst() iterate only on element's children, when the link is wrapped with resize wrapper. So this code does not find link, and setupResizer makes a mess from this inconsistent DOM and parts object.

What do you think about finding the link by parts.image.getParent()? Is the image always link's child?

comment:3 in reply to:  2 Changed 4 years ago by Olek Nowodziński

Replying to Reinmar:

The bug is in this line: https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/image2/plugin.js#L377

getFirst() iterate only on element's children, when the link is wrapped with resize wrapper. So this code does not find link, and setupResizer makes a mess from this inconsistent DOM and parts object.

What do you think about finding the link by parts.image.getParent()? Is the image always link's child?

Sounds like a plan.

comment:4 Changed 4 years ago by Piotr Jasiun

Summary: [Image2] Link is lost when copy&paste captioned image + duplicated resize handle[Image2] Link is lost when copy&paste captioned image or undo + duplicated resize handle

comment:5 Changed 4 years ago by Olek Nowodziński

Owner: set to Olek Nowodziński
Status: confirmedassigned

comment:6 Changed 4 years ago by Olek Nowodziński

Status: assignedreview

Pushed fix to branch:t/11813 (+tests).

comment:7 Changed 4 years ago by Piotrek Koszuliński

Status: reviewreview_passed

comment:8 Changed 4 years ago by Olek Nowodziński

Resolution: fixed
Status: review_passedclosed

git:1c28d47 landed in master (a008cf1 tests).

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy