Click on atom in CKE opens the atom URL in an iframe

Created on 23 May 2019, almost 6 years ago
Updated 27 February 2025, about 1 month ago

Hello,

We recently updated Scald to 1.12 on one of our websites (with Drupal 7.23) and now when I click on an image atom in CKEditor, it replaces the content of the CKE iframe with the image.
This seems to happen because the atom HTML contains an <a> tag so the browser thinks we are clicking on it and nothing prevents this action from happening.

This seems to fix the issue for us:

diff --git a/modules/scald/modules/fields/mee/plugins/ckeditor/plugin.js b/modules/scald/modules/fields/mee/plugins/ckeditor/plugin.js
index 63c6ef4..27b2100 100644
--- a/modules/scald/modules/fields/mee/plugins/ckeditor/plugin.js
+++ b/modules/scald/modules/fields/mee/plugins/ckeditor/plugin.js
@@ -156,6 +156,7 @@ CKEDITOR.plugins.add('dnd', {
       editor.document.on('click', function (evt) {
         var element = dnd.getWrapperElement(evt.data.getTarget());
         if (element) {
+          evt.data.preventDefault(true);
         }
       });
🐛 Bug report
Status

Closed: won't fix

Version

1.12

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024