Allow to load CKEditor multiple times

Created on 1 June 2017, over 7 years ago
Updated 20 September 2023, over 1 year ago

If you load CKEditor multiple times (e.g. by opening it in a lightbox), the ckeditor-3.0.js script is also loaded dynamically multiple times. The init function, however, is only called once. After that, the libraries are initialized. The consequence is, that instanceMap als also only initialized once, but still reset to undefined if the script is reloaded.

It would make more sense to initialize instanceMap when actual keys and values are added. This way, we are on the safe side. A patch is attached.

πŸ› Bug report
Status

Postponed: needs info

Version

2.0

Component

Editor - CKEditor

Created by

πŸ‡©πŸ‡ͺGermany Dword

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.

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡ΈπŸ‡ͺSweden twod Sweden

    I think something sounds wrong if the ckeditor-3.0.js script gets downloaded multiple times. Drupal sends along a list of already loaded scripts in AJAX requests to the server and it should not be including those in the response.
    Could you please provide some more info on the setup and how the lightbox is openened?
    Maybe there's some edge case I've yet to see. If so, that could mean there are more places where this may need to be accounted for (like other editor integrations or the internal Wysiwyg state tracking field instances).

Production build 0.71.5 2024