Problem/Motivation

Drupal 10.5.x/11.2.x includes an updated version of CKEditor.

This causes some errors in the browser console:

Uncaught TypeError: Cannot read properties of undefined (reading 'objectSizeSmall')
    at mediaResize.js?sy5jsh:1:8512
    at mediaResize.js?sy5jsh:1:13436
    at mediaResize.js?sy5jsh:1:13452
    at mediaResize.js?sy5jsh:1:236
    at mediaResize.js?sy5jsh:1:241

When JavaScript aggregation is turned off, the following error appears:

CKEditorError: plugincollection-plugin-not-found {"plugin":null}
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-plugincollection-plugin-not-found
    at ckeditor5-dll.js?v=45.2.0:5:160418
    at ckeditor5-dll.js?v=45.2.0:5:160477
    at Array.forEach (<anonymous>)
    at u (ckeditor5-dll.js?v=45.2.0:5:160279)
    at l.init (ckeditor5-dll.js?v=45.2.0:5:158767)
    at w.initPlugins (ckeditor5-dll.js?v=45.2.0:5:172181)
    at editor-classic.js?v=45.2.0:4:11082
    at new Promise (<anonymous>)
    at w.create (editor-classic.js?v=45.2.0:4:11039)
    at Object.attach (ckeditor5.js?sy5jsh:373:21)

Steps to reproduce

  1. Enable CKEditor Media Resize plugin in Drupal Core 10.5.x or 11.x
  2. Attempt to load CK Editor
  3. Editor fails to load with console errors

Proposed resolution

Update icon compatibility per https://www.drupal.org/node/3528806

Remaining tasks

  • Understand whether this MR then breaks older sites e.g. 10.4
  • Based on that decide if new release version is needed e.g. 2.0.0 and locking 1.0.0 to earlier 11x and 10x versions of core

User interface changes

No change

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rodetrev’s picture

Hi Sebastian, I am getting the same issue in Drupal 10.5.0. It looks like the file ckeditor_media_resize/js/ckeditor5_plugins/mediaResize/src/mediaresizebuttons.js is importing icons from 'ckeditor5/src/core' and this export does not exist. Thanks.

ruslan piskarov’s picture

Not sure, nut maybe related https://www.drupal.org/node/3528806.

scott_euser made their first commit to this issue’s fork.

scott_euser’s picture

Category: Task » Bug report
Issue summary: View changes
Priority: Normal » Major
Status: Active » Needs review
Related issues: +#3523018: Update CKEditor 5 to 45.2.0

Thanks for the tip Ruslan, was exactly that!

  • Going to mark as major as there is no valid workaround except either locking to old version of core or disabling the module
  • Added more detail to the issue summary + remaining issues (ie, deciding on whether a 2.x release of this module is needed - I expect that <=10.4 and <=11.1 both get broken by this, so 1.x may need to be locked to older Drupal Core and 2.x newer Drupal Core
  • Updated title to help people find this a bit easier as I am not sure people will know the root cause is the Drupal Core underlying CKE version update

scott_euser’s picture

Title: Support CKEditor5 45.x » Plugin not found error in CKEditor5 45.x prevents loading of CKEditor5 altogether when enabled
scott_euser’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Needs review » Reviewed & tested by the community

This resolves the problem with 10.5.0.

I think we should create a new minor branch (1.1.x) for this fix, then update 1.0.x to limit its compatibility to <10.5 and <11.2, then the new 1.1.x branch requires 10.5 or 11.2.

scott_euser’s picture

Branching strategy sounds good. And thanks for reviewing!

rajab natshah’s picture

Attached a static ckeditor_media_resize--2025-06-28--3531299--mr-16.patch file, for this point of MR16.
To be used with Composer Patches.

davedg629’s picture

I can't get the patch in #11 to apply while also applying the patch from this issue: https://www.drupal.org/project/ckeditor_media_resize/issues/3401311.

lamp5’s picture

HI @davedg629, the problem is with build so after you applied the patch, you need to rebuild a module and then your conflict will be resolved. Attached the patch that can be applied after:
https://www.drupal.org/files/issues/2024-10-03/3401311_no_html_filter_required.patch
from #3401311: Allow this module to work without "Limit allowed HTML tags and correct faulty HTML" filter

davedg629’s picture

@lamp5 - Thank you! Patch in #13 works great.

ericgsmith’s picture

Change works and fixes the bug - just a minor in that most of the plugins I've seen have moved to using what is exposed by the icon plugin rather than directly referencing the icon path. Its a minor, but it could potentially save effort in the future if the icons are moved around within the plugin.

scott_euser’s picture

Sure go for it, sounds good IMO. As long as it still fixes the issue if that's what the documentation recommends... Thanks!

ericgsmith’s picture

Ta, end of day for me here so I'll test it tomorrow

ericgsmith’s picture

Status: Reviewed & tested by the community » Needs review

Made the following changes

- Bumped the Ckeditor version requirement in package.json to match the version of core 10.5.x / 11.2.x
- Bumped the Drupal core version requirement in the info file to ^10.5 / ^11.2
- Import from the publicly exposed constants instead of the source files

Sorry for knocking it back to needs review from RTBC - have tested on a project and is still working for me

tderego’s picture

Status: Needs review » Reviewed & tested by the community

MR!16 tested in Drupal 11.2.2, works great!

florianboehme’s picture

StatusFileSize
new6.38 KB

MR!16 tested in 10.5.1 and works. But the image has no size?

//editted: Sorry, my fault. It was because: "Limit allowed HTML tags and correct faulty HTML". When activated, no image appears. When I deactivate it, images are back.

anybody’s picture

Any chance to merge this and tag a new release because of the "Major" status (broken projects)?
Thanks!

anybody’s picture

StatusFileSize
new213.15 KB

Static patch from MR!22 current state attached

roshanibhangale’s picture

StatusFileSize
new79.62 KB

Hi

I have tested this on drupal 10 and 11.x and followed the below steps:

Steps to reproduce

  • Enable CKEditor Media Resize plugin in Drupal Core 10.5.x or 11.x
  • Attempt to load CK Editor
  • Editor fails to load with console errors

After applying patch successfully, observed that on editor load no error is displayed. Also while resize the image no error is presnet in console.

Hence this can be moved to RTBC+1. Attaching the screenshot for the reference

jeffschuler’s picture

This indeed broke CKEditor and CKEditor-enabled text fields on our site after upgrading to core 10.5.

Patch from latest MR!16 fixed the issue, with 1.0.0 of this module and Drupal core 10.5.4.

RTBC++

andysipple’s picture

Can confirm Patch from latest MR!16 works!
Our cypress test kept on failing when interacting with a ckeditor.

carma03’s picture

Confirming MR!16 worked successfully on D11.2.4.
Thank you all!

anybody’s picture

Version: 1.0.0 » 1.0.x-dev

Maybe someone could try contacting the maintainers to merge this? Thanks!

damienmckenna’s picture

damienmckenna’s picture

Title: Plugin not found error in CKEditor5 45.x prevents loading of CKEditor5 altogether when enabled » Fix compatibility with CKEditor5 45.x

  • damienmckenna committed 1a57319e on 1.1.x
    Issue #3531299 by sebastian.langierowicz, scott_euser, damienmckenna,...
damienmckenna’s picture

Version: 1.0.x-dev » 1.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed, thanks everyone!

This will be in the 1.1.0 release.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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