Drupal 10.5/11.2 compatability

Created on 22 June 2025, about 1 month 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

    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
    about 1 month ago
    Total: 544s
    #530739
  • πŸ‡ΊπŸ‡Έ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

    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 1 month ago
    Total: 590s
    #538631
  • Pipeline finished with Success
    about 1 month 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
    22 days 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

  • πŸ‡΅πŸ‡°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.

Production build 0.71.5 2024