Skip to content

plugin handle and ckeditor imports - #625

Closed
i-just wants to merge 1 commit into
5.xfrom
bugfix/621-cke-plugins-init
Closed

i-just wants to merge 1 commit into
5.xfrom
bugfix/621-cke-plugins-init

Conversation

@i-just

@i-just i-just commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Description

Wrap registering CKEditor imports in View::EVENT_BEGIN_PAGE so that the order in which Craft’s plugins are loaded does not affect whether the CKEditor plugin registered from it will be registered or not.

(I initially wanted to wrap that registration in Craft::$app->onInit(), but that wouldn’t fix this issue for anyone who registered their CKEditor package via it.)

Steps to reproduce:

  • clean Craft CMS installation with CKEditor plugin installed
  • create 2 Craft plugins in whatever namespace you want, and give the first one a handle that’s alphabetically before 'ckeditor' (aaa) and the other a handle that’s after (ddd)
  • create an asset bundle in each as per: https://github.com/craftcms/ckeditor#custom-plugins; you don’t have to include $toolbarItems, but use AaaPluginTest and DddPluginTest for the $pluginNames respectively
  • each plugin should have a JS file you point to and has to be an actual plugin (just logging something won’t reveal the described behaviour); for example:
import { Plugin } from 'ckeditor5';
export class AaaPluginTest extends Plugin {
  static get pluginName() {
    return 'AaaPluginTest';
  }

  init() {
    console.log('init from plugin "Aaa Plugin"');
  }
}

(adjust for the ddd plugin)

  • require both of those Craft plugins via composer and install them via the CP
  • go to CP > Settings > Fields > [new field] and choose CKEditor as type
  • observe an error in the console that reads something like: Uncaught TypeError: The specifier “@iwona/ddd” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

(the same will happen if you try to edit an entry that has a CKEditor field)

Related issues

#621

@i-just
i-just requested review from brandonkelly and brianjhanson and removed request for brandonkelly September 24, 2026 10:35
@i-just

i-just commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

closing in favour of #628

@i-just i-just closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants