Steps to reproduce
- Follow the steps here https://www.drupal.org/docs/8/core/modules/media-library-module/embeddin... to enable embedding media library images in CKEditor.
- Create or edit a page, and in CKEditor open the Media Library and select/upload an image.
- Once the image is embedded, select it - it should have border with a grab handle (crosshairs) top left.
- Click the grab handle and drag to another location in your content - nothing happens.
- A JS error is generated:
Note that:
- If you embed more images, you can drag and drop these using the drag handle.
- If you cut the first image, and paste it back in again, then you can drag and drop it using the drag handle.
This appears to be a known bug in CKEditor 4.14.0 - see https://github.com/ckeditor/ckeditor4/issues/3926. I was using a recent version of Chrome (version 81.0.4044.138) on a Mac (macOS Catalina 10.15.4).
Temporary workaround
It may be possible to patch as suggested here - https://github.com/NogaMan/ckeditor4/commit/d4375ba140d8964361014153884e... - but this would need to be applied to an un-minified build of Drupal's core ckeditor.
Just as a quick verification, I attempted to do this on the optimised/minified version (in core/assets/vendor/ckeditor/ckeditor.js). Obviously I wouldn't recommend anyone actually doing this. I replaced if(!c&&!d){var f=this.editor.editable(); with if(!c&&!d&&d!==0){var f=this.editor.editable(); and replaced (!f&&0<b.widgets.selected.length) with
(!f&&f!==0&&0<b.widgets.selected.length), did a cache rebuild and it seemed to work.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2020-05-21 at 16.42.57.png | 72.01 KB | glugmeister | |
| Screenshot 2020-05-21 at 16.42.42.png | 503.86 KB | glugmeister |
Comments
Comment #2
glugmeister commentedComment #3
johan.gant commentedTested this on simplytest.me with the latest Umami install profile + demo site and it occurs there. I'm not sure at the moment how best to incorporate any upstream CKEditor project patches alongside Drupal core. Could definitely use some community input from someone who has a detailed understanding of this component of Drupal.
Comment #6
maacl commentedI created an Issue and a patch to update CKeditor to version 4.14.1: #3155110: [backport] Update CKEditor to version 4.14.1
Comment #7
wim leersComment #8
maacl commentedCkeditor has been updadet in Drupal Core, this includes a Bugfix for this issue.