Opened 12 years ago
Closed 12 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
- Open image2 sample.
- Link the image.
- 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 12 years ago by
comment:2 follow-up: 3 Changed 12 years ago by
| Milestone: | → CKEditor 4.4.1 |
|---|---|
| Status: | new → confirmed |
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 Changed 12 years ago by
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 12 years ago by
| 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 12 years ago by
| Owner: | set to Olek Nowodziński |
|---|---|
| Status: | confirmed → assigned |
comment:7 Changed 12 years ago by
| Status: | review → review_passed |
|---|
comment:8 Changed 12 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review_passed → closed |
git:1c28d47 landed in master (a008cf1 tests).

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