Problem/Motivation
Drupal 10 drops the support for CKEditor 4 and all CKEditor plugins need to be updated to CKEditor 5. At the moment this module doesn't support CKEditor 5 and would need an update path.
There is a list for CKEditor plugins to be updated to CKEditor: https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...
Steps to reproduce
1. Enable the CKEditor 5 module.
2. Edit your CKEditor settings, the plugin is visible when CKEditor 4 ised but it's not possible to enable it if you change to CKEditor 5.
Proposed resolution
Update the module to support CKEditor 5.
Remaining tasks
1. Create migration path to CKEditor 5.
2. Test that update works.
User interface changes
Enable the module setting in CKEditor 5 setting page.
API changes
Change to CKEditor 5 API's.
Data model changes
Needs to be reviewed.
Comments
Comment #2
heikkiy commentedComment #3
ivnishI used this module to block paste images as base64 (because they saved to database)
I upgraded one site to CKEditor 5 and now images uploaded to files directory when pasted. If you use this module as me, you don't need this module anymore
Comment #4
askibinski commentedCan anybody else confirm that this module is not needed anymore in ckeditor 5?
Comment #5
heikkiy commented@askibinski I tested this with CKEditor 5 and the comment from #3 is not true.
If you use the Media button in CKEditor 5 you use the Drupal file system to store the images. But if you use the normal Image button, the images are still external like before and will get stored to the database.
I tested creating an Image from the image https://upload.wikimedia.org/wikipedia/commons/b/bd/Test.svg and also pasting the following base64 test image https://codepen.io/jamiekane/pen/YayWOa.
Both are saved to the editor and displayed in source like this:
These do not get converted to Drupal files at least in my testing.
All this said, I also tested this module but ended up using CKEditor 5 Paste Filter to filter out pasted content instead of trying to update this module for Drupal 10 / CKEditor 5 support. I feel like we could also deprecate this module and point users to that filter module. It seems much more robust and can also filter out pasted content to solve the issue I and @ivnish had with base64 images being pasted to the editor.
Comment #6
ivnishI tested only the most popular scenarios in my site - drag'n'drop image from local PC files to CKEditor and copy/paste from browser to CKEditor. In both cases I don't get base64 and files were uploaded to site files.
I don't tested any media entities cases with CKEditor
Comment #7
heikkiy commented@ivnish
I used the exact same process with the Image button and I still get
<img>tags with the external image. I wonder if there is CKEditor 5 setting that is different in our setups?There are at least two settings in CKEditor 5 that could affect the end result:
I tested that if I enable those settings I cannot anymore paste an image URL to the Image tool but I need to select the image from my computer. This does create the images as inline images in the file system. But even in this case I can also insert an external if I copy the image first in browser and then paste it.
This results in the following:
In any case it still seems that with certain CKEditor 5 configuration you are able to insert base64 images like before so the actual problem still exists that this module was originally solving.
Comment #8
askibinski commentedI tested this on CKEditor 5 in two ways:
Please note that the img tag needs to be allowed otherwise blocking isn't necesseary anyway (like the project page of this module states).
1: Copy an image (not the address) from any webbrowser and paste it into ckeditor 5.
This would create an img but with the src being the http:// address of the image.
This is hotlinking an image, but not something this module is addressing.
2: Drag and drop an image from your local system into ckeditor 5.
This would create the base64 encoded image in ckeditor 4, but it seems to be blocked by default in ckeditor 5.
I think the default ckeditor build without additional plugins doesn't allow this out of the box.
There is a demo at https://ckeditor.com/docs/ckeditor5/latest/features/images/image-upload/... which does provide this functionality but it is differently configured.
So, it seems that in a standard configuration as described, this module is not necessary anymore. I'm not sure how to reproduce the steps above which state otherwise.
Comment #9
ion.macaria commentedOn Ckeditor 5 when you are trying to paste image from Microsoft Office Word (Windows), it returns base64 object. It uploads image just when you are adding image element and enable "upload image". But what to do when you don't want image element to be uploaded to your files folder.
For sure this module logic is necessary on CKeditor5!