Ckeditor4: Image dialog has null URL field when inside table cell

Created on 10 Aug 2017  路  8Comments  路  Source: ckeditor/ckeditor4

Are you reporting a feature request or a bug?

Bug

Demo page:

http://maracms.com/ck/

Procedure to replicate:

  1. Create page with table containing jpeg image.
  2. Load CK 4.7.1 in inline mode to edit this region.
  3. Open the dialog for the image by double clicking.

Expected result

Dialog should show correct source file or URL for image.

Actual result

The URL field of the image dialog is null.
An error popup displays 'source is null' on trying to save changes to the image.

Other details

  • Browser: Firefox 54
  • OS: Mint Serena.
  • CKEditor version: 4.7.1
  • Not present with CK 4.6.2
  • Installed CKEditor plugins: Standard full set, unmodified.
  • Also tested on Windows / Chrome / Firefox 40 with same result.
  • Some intermittency of bug observed. It is more likely to show if the alignment field is changed.
  • Minor issue with table border css also noted.
image tableselection regression duplicate confirmed minor bug

Most helpful comment

Thanks for the detailed report @iwrconsultancy. It looks to be an issue of our new tableselection plugin.

The issue happens if the img element is the only child inside the cell and only in inline editor, see https://codepen.io/mlewand/pen/prWPwa

Also image2 is not affected by this issue.

All 8 comments

Tried replacing the image and table plugins with those from 4.6.2, but no difference. (Appreciate these plugins might not be fully compatible but thought it might give some pointers.)
Unfortunately no. Looks like it might be in the system itself.
Also, I note that most of the properties of the image are being lost, not just the URL, along with the link properties.

I meant Standard OR Full plugin set, btw.

The bug arises with any image inside a table cell, even if there are intervening p, div or other block tags around or before the image. Multiple images in a td all show the problem.
HTH.

I though, this here is the same issue: https://github.com/ckeditor/ckeditor-dev/issues/686

It seems unlikely this is related to #686. This is an issue with the standard image dialog which has arisen in the 4.7 series.

Though, the image2 plugin does seem to have big issues with drag and drop repositioning of images anyway. I've always preferred the original.
.

Thanks for the detailed report @iwrconsultancy. It looks to be an issue of our new tableselection plugin.

The issue happens if the img element is the only child inside the cell and only in inline editor, see https://codepen.io/mlewand/pen/prWPwa

Also image2 is not affected by this issue.

I confirm that preceding text in the cell (image no longer first child) mitigates the bug.
Placing the image inside a nested div or p container does not mitigate the bug.
Image2 loaded mitigates the bug.

I have a similar issue. Using image2, have a lone image in a table cell. Double-clicking the image shows the correct URL. Right clicking the image, opening via context menu's 'Image Properties' has empty URL field.

Adding text before the image fixes the issue.

EDIT: using 4.7.2; EDIT2: inline editor

The reason of this bug is activation of fake-selection mode in TD. I don't have enough informaton about purpose of using this mode in CKEditor, but if you take image plugin, line 290 in file plugins/image/dialogs/image.js, find onShow function, and set parameter forceRealSelection=true of getSelection (it's only parameter of method), right-clicking the image starts to work fine! My version in use is 4.7.3.
sel = editor.getSelection(), => sel = editor.getSelection(true),

Closing this one as a duplicate of #2235 (since it contains some information on workaround - https://github.com/ckeditor/ckeditor-dev/issues/2235#issuecomment-479808222).

Please follow the #2235 to track the progress (there is already a PR with potential solution proposed).

Was this page helpful?
0 / 5 - 0 ratings