Drupal 10.5/11.2 compatability

Created on 22 June 2025, 2 months ago

Problem/Motivation

10.5 and 11.2 include an update of CKEditor to v45 which has breaking changes that impact this module.

All CKEditor 5 icons are now available in the @ckeditor/ckeditor5-icons package.

https://ckeditor.com/docs/ckeditor5/latest/updating/guides/update-to-45....

Steps to reproduce

Install module on 11.2 or 10.5
Embed an entity
Plugin will crash once an entity has been embedded

Proposed resolution

1. Update icon import path - see https://git.drupalcode.org/project/drupal/-/blame/11.x/core/modules/cked... and https://git.drupalcode.org/project/drupal/-/blame/11.x/core/modules/cked... as examples.

It looks like this is limited to:

  1. js/ckeditor5_plugins/drupalentity/src/toolbar.js
  2. js/ckeditor5_plugins/drupalentity/src/linkui.js

2. Update declared version compatibility in info file

Remaining tasks

Implement

User interface changes

n/a

API changes

n/a

Data model changes

n/a

๐Ÿ“Œ Task
Status

Active

Version

2.0

Component

CKEditor integration

Created by

๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

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

Merge Requests

Comments & Activities

  • Issue created by @ericgsmith
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Fixed - pretty sure I've got the right link icon. It was removed from the way this plugin was loading it (see https://github.com/ckeditor/ckeditor5/issues/17304) and I saw there was a `IconLink` in the main package now so using that.

    Core version req - I bumped this because of the plugin, but I guess some people might be using the filter without CKEditor?

    Not 100% we need to bump it, if we don't then people on 10.4 could update before they go to 10.5 or 11.2 and it would break for them.

    Quick test of the syntax I used>

    drush php:eval "var_dump(\Composer\Semver\Semver::satisfies('10.4.7', '>=10.5 <11.0 || ^11.2'))"
    bool(false)
    drush php:eval "var_dump(\Composer\Semver\Semver::satisfies('10.5.0', '>=10.5 <11.0 || ^11.2'))"
    bool(true)
    drush php:eval "var_dump(\Composer\Semver\Semver::satisfies('10.6.0', '>=10.5 <11.0 || ^11.2'))" 
    bool(true)
    drush php:eval "var_dump(\Composer\Semver\Semver::satisfies('11.0.0', '>=10.5 <11.0 || ^11.2'))"
    bool(false)
    drush php:eval "var_dump(\Composer\Semver\Semver::satisfies('11.1.0', '>=10.5 <11.0 || ^11.2'))" 
    bool(false)
    drush php:eval "var_dump(\Composer\Semver\Semver::satisfies('11.2.0', '>=10.5 <11.0 || ^11.2'))"
    bool(true)
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Tests failing - current major still set to 11.1?

  • Pipeline finished with Failed
    2 months ago
    Total: 544s
    #530739
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jayemel

    Thanks for this. Any update when this will be merged and released? It is site breaking for us.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    If somebody can review / test so that it can be moved to RTBC, I'm happy to reach out to maintainers to ask them to get it committed - but I think its fair to wait till the status is RTBC before doing this.

  • ๐Ÿ‡ฏ๐Ÿ‡ดJordan Rajab Natshah Jordan

    Facing the same issue. thank you for the MR

  • ๐Ÿ‡ฏ๐Ÿ‡ดJordan Rajab Natshah Jordan
  • ๐Ÿ‡ฏ๐Ÿ‡ดJordan Rajab Natshah Jordan

    Attached a static entity_embed--2025-06-30--3531672--mr-62.patch file, to this point of MR62.
    To be used with Composer Patches

  • The patch fixes the issue for me. Thanks!

  • ๐Ÿ‡ฏ๐Ÿ‡ดJordan Rajab Natshah Jordan

    Thanks to Eric for MR62, the patch file is only a static point of the plain diff

  • Patch is working for me as well. Thanks!

  • Pipeline finished with Failed
    about 2 months ago
    Total: 590s
    #538631
  • Pipeline finished with Success
    about 2 months ago
    Total: 621s
    #538632
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States pmagunia Philadelphia ๐Ÿ‡บ๐Ÿ‡ธ

    There's a yarn.lock file in the MR.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jayemel

    When will the maintainers give this some attention? This essential module is broken on current versions of Drupal.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Re #16 - yes I didn't realise this wasn't already committed. It wasn't present but also isn't it the gitignore so not clear here. It's pretty common to commit the yarn.lock file as it can ensure dependency versions aren't changed until it's intentional

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Tests are still failing and it's not clear it it's related to this change or not, would be good to get a green pipeline.

    Phpunit on previous minor is expected to fail as it's not compatible, but the current job is now testing on 11.2 and there is 2 failures there.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 551s
    #545461
  • I have several sites that are currently unable to be updated to Drupal 10.5 due to this issue. Any updates on when this issue will be resolved?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    May have found a valid bug, when you add a link to an embedded entity you can't go back and edit that link. The icon just doesn't work.

    Uncaught CKEditorError: r._addActionsView is not a function

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Believe I got that correct replacing _addActionsView with _addToolbarView

  • Pipeline finished with Failed
    about 1 month ago
    Total: 601s
    #555187
  • ๐Ÿ‡ต๐Ÿ‡ฐPakistan hamza_niazi

    this patch mr-62 resolved my issue thanks.

  • ๐Ÿ‡ต๐Ÿ‡ฐPakistan hamza_niazi

    created this patch just a few changes to the patch mr-63 to allow only edit link in toolbar

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States jennypanighetti

    Not sure what I'm doing wrong, but MR-62 applied via composer (on 10.5.1) did not resolve my issue. I still see no way to edit embedded media items, though at least the white arrow is gone.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Thanks @smustgrave!

    Confirming your change in d130db37 looks correct as per this change - https://github.com/ckeditor/ckeditor5/commit/4a595753940ab2087db7901922b...

    Still have some unexplained test failures here - not really sure I'll have time to dig further into these

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Ok - did end up trying to investigate these.

    The last CI run shows the following tests failing:

    58.307s Drupal\Tests\entity_embed\FunctionalJavascript\EntityEmbedDialogTest      0 passed, 1 failed, 1 log(s)
    209.891s Drupal\Tests\entity_embed\FunctionalJavascript\ButtonAdminTest            3 passed, 1 failed, 1 log(s)
    177.661s โ€ฆupal\Tests\entity_embed\FunctionalJavascript\CKEditor5IntegrationTest    0 passed, 2 failed, 16 errored, 1 log(s)

    I ran these locally on 11.2.2 with same phpunit version. The first 2 pass (with deprecations):

    $ phpunit -c app/core/phpunit.xml app/modules/contrib/entity_embed/tests/src/FunctionalJavascript/EntityEmbedDialogTest.php 
    PHPUnit 11.5.27 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.3.23
    Configuration: /data/app/core/phpunit.xml
    
    .                                                                   1 / 1 (100%)
    
    Time: 00:38.220, Memory: 12.00 MB
    
    OK, but there were issues!
    Tests: 1, Assertions: 6, PHPUnit Deprecations: 5.
    
    
    $ phpunit -c app/core/phpunit.xml app/modules/contrib/entity_embed/tests/src/FunctionalJavascript/ButtonAdminTest.php 
    PHPUnit 11.5.27 by Sebastian Bergmann and contributors.
    
    Runtime:       PHP 8.3.23
    Configuration: /data/app/core/phpunit.xml
    
    ....                                                                4 / 4 (100%)
    
    Time: 03:09.833, Memory: 12.00 MB
    
    OK, but there were issues!
    Tests: 4, Assertions: 32, PHPUnit Deprecations: 16.
    

    The last one CKEditor5IntegrationTest.php does indeed fail multiple times.

    RuntimeException: The autoloader expected class "Drupal\embed\Plugin\CKEditor5Plugin\EmbedCKEditor5PluginBase" to be defined in file "/data/app/modules/contrib/embed/src/Plugin/CKEditor5Plugin/EmbedCKEditor5PluginBase.php". The file was found but the class was not in it, the class name or namespace probably has a typo.

    Looks like in the embed module that class is using the wrong namespace - it has Drupal\entity_embed\Plugin\CKEditor5Plugin

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand ericgsmith

    Adding ๐Ÿ› The namespace of EmbedCKEditor5PluginBase does not respect PSR4 Active as a related issue - that will need to land first for the tests to go green.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON

    Thanks for the patch friends!

    I had a bit of trouble finding this issue. Making adjustments to the Issue Summary to help other folks find it.

    I'm also attaching a patch that leaves out yarn.lock just b/c its large, and maintainers haven't piped in yet on whether thats desireable. IMO its a good idea (also noted in #18) for the module going forward, however it might be out of scope and makes the patch big.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada m4olivei Grimsby, ON
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia JatinGupta40

    As soon as i have updated the Drupal version from 10.4.8 to 10.5.0, i got this same issue.
    Patch on #29 resolves the issue.

    Thanks.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia JatinGupta40

    In the newer CKEditor version, the styling and layout of the edit toolbar/balloon have changed.

    However, with the applied patch, the toolbar/balloon still appears with the older styling and layout.

    We may need to update the MR to align with the new CKEditor styling.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States butterwise

    Patch in #29 worked for me when going from 10.4.8 to 10.5.2. I am now seeing the old toolbar which is better than none.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bkosborne New Jersey, USA
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bkosborne New Jersey, USA

    This works as expected and restores the original toolbar. RE: #32, I think it's best that be handled in a follow up so we can restore this critical functionality.

  • Pipeline finished with Failed
    9 days ago
    Total: 497s
    #573931
Production build 0.71.5 2024