Closed CaptainChaos closed 3 years ago
I just found out about the CKEditor Setting TEXT_SAVE_IMAGE_FUNCTION, maybe it would be better to include an override function for this to djangocms-bootstrap4 and mention it in the readme. For my needs, I'll go this way and create a PR.
In djangocms_text_ckeditors file picture_save.py, the model djangocms_picture.Picture is try-loaded (which is available since it's a dependency for Bootstrap4Picture). During initialisation, Bootstrap4Picture calls plugin_pool.unregister_plugin(PicturePlugin), so copy-pasting a picture into CKEditor results in a KeyError since a PicturePlugin is created, but not available in the PluginPool.
The first fix which comes to my mind is try-loading Bootstrap4Picture before trying to load djangocms_picture.Picture in picture_save.py