Steps to reproduce:
1. Go to any content add page with textarea field with ckeditor enabled(even for full html format as admin)
2. Click on image add plugin button from toolbar.
3. Insert some image url there and hit save.
4. Now if you double click on image, the edit modal opens with previously inserted details.
5. Now click on view source and then click on it again to normal wsiwyg mode.
6. double click on the image inserted and now the image edit modal no longer opens.
Cause of Issue:
From what i can debug, the issue is related to ckeditor plugin wrappers around the image getting removed once the view source has been clicked. coming back to wsiwyg mode doesn't add the wrappers back around the image and the ckeditor events to open edit image modal are binded to that wrapper.
Html around the image inserted before Clicking view source and image modal opens up on double click:
<body class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders"
spellcheck="true" style="height: auto; min-height: auto;" contenteditable="true">
<p><span tabindex="-1" data-cke-widget-wrapper="1" data-cke-filter="off" class=
"cke_widget_wrapper cke_widget_inline cke_widget_image cke_image_nocaption"
data-cke-display-name="Bild" data-cke-widget-id="0" role="region" aria-label=
"Bild Steuerelement" contenteditable="false"><img alt="" src=
"http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2015/04/1428068708logo_drupal.png"
data-cke-widget-keep-attr="0" data-widget="image" class="cke_widget_element"
data-cke-widget-data=
"%7B%22hasCaption%22%3Afalse%2C%22src%22%3A%22http%3A%2F%2Fdab1nmslvvntp.cloudfront.net%2Fwp-content%2Fuploads%2F2015%2F04%2F1428068708logo_drupal.png%22%2C%22alt%22%3A%22%22%2C%22width%22%3A%2250%22%2C%22height%22%3A%2250%22%2C%22lock%22%3Atrue%2C%22align%22%3A%22none%22%2C%22classes%22%3Anull%7D"
data-cke-saved-src=
"http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2015/04/1428068708logo_drupal.png"
width="50" height="50" /><span class="cke_reset cke_widget_drag_handler_container"
style=
"background: rgba(220, 220, 220, 0.5) url("http://hzd.d8/core/assets/vendor/ckeditor/plugins/widget/images/handle.png") repeat scroll 0% 0%; top: -15px; left: 0px; display: block;"><img class="cke_reset cke_widget_drag_handler"
data-cke-widget-drag-handler="1" src=
"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw=="
title="Zum Verschieben anwählen und ziehen" role="presentation" draggable="true"
width="15" height="15" /></span><span class="cke_image_resizer" title=
"Zum Vergrößern auswählen und ziehen">​</span></span><br /></p>
</body>
After clicking view source , the html around the image:
<body class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders"
spellcheck="true" style="height: auto; min-height: auto;" contenteditable="true">
<p><img alt="" data-entity-type="" data-entity-uuid="" data-cke-saved-src=
"http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2015/04/1428068708logo_drupal.png"
src=
"http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2015/04/1428068708logo_drupal.png"
width="50" height="50" /></p>
</body>
Comments
Comment #2
sumanthkumarc commentedComment #3
wim leersI can't reproduce this:
The image modal dialog continues to appear just fine for me.
Can you record a screencast, to ensure I'm not misunderstanding the problem?
Comment #4
wim leersComment #5
sumanthkumarc commented@wimleers, yes will do.
Comment #6
wim leersThanks!
Comment #7
sumanthkumarc commentedLooks like there is something on our site, which breaks this or using old version. worked fine on latest vanilla. Closing this issue.
Comment #8
kevinhbruce commentedThis exact thing is happening to my site. After placing an image, I can resize, add caption, and double-click to reopen the image dialog, but when I go into source view and come back out, it acts like the editor doesn't see it as an actionable image anymore. I can't resize, I can't doubleclick to reopen the image dialog.
This same issue happens when editing an existing page—none of the images are actionable, because the image resizer doesn't appear (knowing this is a separate module) and I can't reopen the image dialog by double-clicking on the image.
I'm running Drupal 8.8.5
Comment #9
rjw commentedI ran into this issue, as described in the original post, on a new Drupal 9 site. That site is using IMCE, but the problem can be reproduced on a new vanilla Drupal 9.2.1 site with the standard install profile. Using simplytest.me:
You don't even have to view/unview source. If you insert the image, save the page, then edit again, same problem.
The inserted image tag looks like this:
<img alt="test" data-entity-type="" data-entity-uuid="" src="/core/themes/bartik/logo.svg" />If you put something into the empty attributes, though, Image Properties works again:
<img alt="test" data-entity-type="y" data-entity-uuid="z" src="/core/themes/bartik/logo.svg" />It seems like Image Properties works on any image with non-empty data-entity-type and data-entity-uuid attributes. If they're empty or missing, then no dice. (My site with IMCE was producing img tags with empty data-entity attributes.)
Here's another interesting clue. If you go back to the Full HTML text format and disable Align Images, then Image Properties works again, even with empty data-entity attributes.
Comment #10
wim leersComment #14
quietone commentedCKEditor has been removed from core, CKEditor 4 is removed from Drupal Core in 10.0.0