Incompatible with Drupal Core 10.5 / CKEditor 45

Created on 20 June 2025, 4 days ago

Problem/Motivation

The CKEditor generates a JS-error on the console in Drupal 10.5.0 with the upgraded CKeditor 45:

TypeError: Cannot read properties of undefined (reading 'check')
    at new d (abbreviation.js?sy5a3z:1:3972)
    at b._createFormView (abbreviation.js?sy5a3z:1:7343)
    at b.init (abbreviation.js?sy5a3z:1:5502)

It is not loaded at all after this error.

Steps to reproduce

Install Drupal 10.5.0 with ckeditor_abbreviation.

Proposed resolution

Fix breaking changes from: https://ckeditor.com/docs/ckeditor5/latest/updating/guides/update-to-45....

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

5.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany harkonn

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

Merge Requests

Comments & Activities

  • Issue created by @harkonn
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel

    Since ckeditor 45.0.0 the icons were moved into its own package @ckeditor5/ckeditor5-icons

    Therefore the import has to be adjusted in abbreviationview.js

    From

    import { icons } from 'ckeditor5/src/core';
    

    To

    import { icons } from 'ckeditor5/src/icons';
    

    But I think this is a breaking change. Maybe we need a new branch with a new drupal core supporting version?

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dharmeshbarot Gujarat

    Hey @sunlix, I've checked this by applying the changes that you have mentioned but issues is still persist, could you please check again!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Shaikh Sadab

    The issue was caused by missing or undefined icon references in the JavaScript build file located at:
    `/ckeditor_abbreviation/js/build/abbreviation.js`

    I modified the file by replacing the undefined icon references with fallback values.

    Changes Made:

    Line 188
    Replaced:
    e.icons.check
    With:
    (e.icons && e.icons.check) || '

    Line 194
    Replaced:
    e.icons.cancel
    With:
    (e.icons && e.icons.cancel) || '

    Line 200
    Replaced:
    e.icons.eraser
    With:
    (e.icons && e.icons.eraser) || '

    These changes ensure the script does not break when the icon is undefined by falling back to a basic empty `

    ` element.
  • Pipeline finished with Failed
    4 days ago
    #527184
  • Pipeline finished with Failed
    4 days ago
    Total: 366s
    #527214
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    Precise error in console that i was getting with Drupal 11 and CKEditor 45.2:

    "TypeError: e.icons is undefined"

    Given that the icon package is at play here, that i'm not finding that error message on the internet anywhere, and that CKEditor Abbreviation is the only extra module for CKEditor we have, i think it has to be related.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    The merge request deletes the built file, resulting in an unsurprising error of this kind: The requested URL /modules/contrib/ckeditor_abbreviation/js/build/abbreviation.js was not found on this server.

    Given that it was committed before i presume there is a step committers should take to generate the file and then commit it?

    And agree that a new major version release makes sense and we can have it version 6 require Drupal core 10.5 / 11.2 or later.

    Really rotten of CKEditor to fail this badly on a breaking change; one thing for the plugin or even CKEditor to not work but for it to blank out all text on save is the worst possible behavior.

  • Pipeline finished with Failed
    3 days ago
    Total: 274s
    #527389
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel

    Sorry for the deleted build artifact. I messed up with the MR because the default branch is 4.0.x and I oversaw the target branch and rebased like a monkey :D

    I added the build artifact with the changes, that should running again. But the tests are failing.
    Didnt find out the reason. I will dig in later.

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel

    The current test piplines are running with Drupal 11.1.7 and 10.4.7.
    So the tests are running against ckeditor 44 and not 45.

    I added OPT_IN_TEST_NEXT_MINOR to test on 10.5.0 with ckeditor 45.

  • Pipeline finished with Failed
    about 17 hours ago
    Total: 265s
    #529156
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel

    With ckeditor 45 the tests are green.

    How to proceed here? Branch a new major and set new version constraint on 5.0.1?
    Or is there a way to support ckeditor 44 and 45 in parallel?

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mparker17 UTC-4

    Maintainer here! Sorry for the delay; it's been a busy few weeks for me.

    I have been able to reproduce the problem on Drupal 10.5.0, and can confirm that the code in the patch fixes the issue; but I cannot merge code with broken tests. I also notice some issues in the code: I'll leave some comments in the merge request shortly. For these two reasons I am marking this issue as "Needs Work".

    I'll do some more research into compatibility with forward and backward compatibility with Drupal core. There does appear to be some activity in ๐Ÿ“Œ Update CKEditor 5 to 45.0.0 Active (core), and ๐Ÿ› D11.2: Uncaught CKEditorError: Cannot read properties of undefined (reading 'viewUid') Active (editor_advanced_link, another module that integrates with CKEditor) to keep an eye on.

    While I was updating the issue summary, I tried to find a link to @ckeditor5/ckeditor5-icons in the NPM Package List, but couldn't. @sunlix, do you have a link to this new package?

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany sunlix Wesel

    @mparker17

    sure.

    NPM: https://www.npmjs.com/package/@ckeditor/ckeditor5-icons
    GitHub: https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-icons

    Please note that this package is new since 45.0.0 of ckeditor5.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

    (crosspost)

    This is great! Works and the code change is straightforward. I would change to RTBC except for the decision on how to commit and release.

    My 2ยข is to do the new major with different version constraintsโ€” and hope CKEditor does not make a habit of this level of breaking change!

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mparker17 UTC-4

    @sunlix, thanks I've updated the issue summary.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mparker17 UTC-4

    My multiple version testing results...

    In the table below:

    • โœ… means that I was able to see the CKEditor on the node/edit page, I was able to enter an abbreviation using the CKEditor Abbreviation button, and the abbreviation worked on the node/view page
    • โŒ means CKEditor did not load on the node/edit page, and thus I was not able to proceed further with testing. I've listed the error shown in the console (but not the stack trace, in part because my JS was minified)

    All four sites were set up identically: Standard install profile; CKEditor Abbreviation added to Basic HTML text format; went to /node/add/article to test.

    ... I'll interpret this in another comment; just wanting to save it here.

Production build 0.71.5 2024