[5.x] Plugin relies on loading order for custom plugins
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 47
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Description
This plugin immediately registers custom plugins' namespaces in its own init function:
https://github.com/craftcms/ckeditor/blob/0abec0bba0c90c39bb586c983c9b51d57d24010b/src/Plugin.php#L71-L76
Given that Craft loads plugins in alphabetical order (as of https://github.com/craftcms/cms/commit/2540de56f99d9f3b38bbc14070c433ccf00b56ab), this prevents any custom CKEditor plugins with a name alphabetically past CKEditor's own (e.g. ckeditor-some-plugin) from registering themselves.
Steps to reproduce
- Set up a new CKEditor plugin with a handle alphabetically past CKEditor's (e.g.
ckeditor-test) - Install it
- Notice that it never shows up in the page's
importmapand the plugin'sinit(where you must register the CKEditor package) is called after CKEditor's owninit
A complete reproduction can be found here: https://github.com/lexisother/ckeditor-load-order-repro
Video
https://github.com/user-attachments/assets/d8a21a73-b070-46d8-9141-eacb6c58b22d
Additional info
- Craft version: 5.11.1
- PHP version: 8.3
- Database driver & version: MySQL 8.0.40
- Plugins & versions: CKEditor 5.7.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/Plugin.php lines 71-76 and compare its init behavior with the loading sequence described in the issue. Use the linked ckeditor-load-order-repro to verify a custom plugin such as ckeditor-test is included in the page importmap and initialized successfully regardless of alphabetical order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100