CKEditor 5 compatability

Created on 17 October 2022, about 2 years ago
Updated 17 November 2023, about 1 year ago

Problem/Motivation

In Drupal 10, CKEditor 4 will be replaced with CKEditor 5. It can be tested following the steps on https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito... β†’ . See also https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito... β†’

When changing an text format to use CKEditor5 instead of CKEditor, a message is displayed to stating. "The CKEditor 4 button detail does not have a known upgrade path."
Existing details/accordions in a text field are still displayed correctly, but there's no button that can be added to the toolbar and therefore no option for an editor to add new details/accordions into the text.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands ifrik

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 Needs work almost 2 years ago
  • I updated the way the entire contents of the summary are selected for replacement. It was junky to begin with. The update still needs the placeholder test, otherwise it will add some extra <br> elements (but it won't delete the entire contents of the WYSIWYG).

    The CKE4 version of the plugin includes translations for English, German, Russian, and Ukranian. The strings that need to be translated are "Add details" (the title of the button) and "Details" (the default content that gets placed in the summary).

    What is your preferred behavior when the summary is empty? Would you like it insert "Details"? That looks like intended behavior in the CKE4 version of the plugin (line 89). At one point I got that functionality working and I could add it again if you prefer. However, I left it out because when I used the CKE4 plugin and removed the default text the summary stays empty.

  • Status changed to Needs review almost 2 years ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    I added a commit that switches to Drupal.t() for string translation. That should pull in any existing translations (since that's what the CKE4 version used), or at least allow it to be manually translated. I did verify that after the change I could find the string in the interface translation module.

    I'm OK with leaving the summary empty after it loses focus, particularly since it maintains parity with the CKE4 version.

    If the above is OK, is there anything left to do?

  • I don't think there's anything else.

    The only question I had was whether the keyup event needed to be added. It was initially added in the final patch for Issue 3201638 β†’ . I'm not seeing the behavior is supposedly fixes (cursor jumping to the beginning), but maybe I'm missing something (I used Firefox on Mac). So I suppose it's not still needed.

  • @mandclu opened merge request.
  • Status changed to Fixed almost 2 years ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    Merged this into the 2.x branch, and will roll an alpha release soon to get feedback from site owners on how this works for them in Drupal 10.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    Should this work in CKEditor 5 on Drupal 9.5 using version 2.1.x-dev? I am not seeing a toolbar button. No errors in the log or the browser.

Production build 0.71.5 2024