Problem/Motivation
In Chrome (but not Firefox), inserting an image via IMCE into a previously inserted Template (from the Templates submodule) triggers a contextualballoon-remove-view-not-exist error. Subsequent image insertions then fail with collection-remove-404.
Steps to reproduce
Environment: Drupal 10.5.x | CKEditor v45.2.2 (v44.0.0 worked fine)
Browser: Chrome
Chrome -> Wysiwyg -> Responsive Columns (Success) -> Image 1 (Successfully placed image with an Error) -> Image 2 (Crash)
Technical Details: The error occurs because drupalImage.js and the Template plugin both attempt to manage the ContextualBalloon stack simultaneously. When the IMCE modal shifts focus, the balloon is auto-closed by the core. When balloon.remove(view) is subsequently called by the plugin, it crashes because the view is already gone.
Proposed resolution
Wrap balloon removal calls in a hasView() check:
if (this._balloon.hasView(this.templateView)) { this._balloon.remove(this.templateView); }
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2026-04-20 at 11.55.44 AM.png | 431.56 KB | gladys_loa |
Comments
Comment #2
gladys_loa commentedI will be opening the bug with CKEditor, it seems to be happening outside of templates. Feel free to delete or close this bug.
Comment #3
mdusza commented