- Issue created by @tjtj
- Status changed to Postponed: needs info
about 2 years ago 7:01pm 8 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Woah, that sounds very bad!
If you can provide steps to reproduce, we can write tests that reproduce it and get this fixed 😊
As far as I can tell, this error is caused by failing to check for null values on line 79 of CKEditor5StylesheetsMessage.php.
The whole block reads as such:
// Collect information on which themes/base themes have ckeditor_stylesheets // configuration, but do not have corresponding ckeditor5-stylesheets // configuration. $ckeditor_stylesheets_use = []; foreach ($themes as $theme_info) { $this->checkForStylesheetsEquivalent($theme_info, $ckeditor_stylesheets_use); }
The problem is that in this case $themes has an object in it that's null. I haven't looked into why this might be or what causes it because it doesn't seem to be causing errors elsewhere (yet). In my case, it was a 2-long array with one theme and one null.
Issue was fixed by checking for null values.
// Collect information on which themes/base themes have ckeditor_stylesheets // configuration, but do not have corresponding ckeditor5-stylesheets // configuration. $ckeditor_stylesheets_use = []; foreach ($themes as $theme_info) { if (!empty($theme_info)) { $this->checkForStylesheetsEquivalent($theme_info, $ckeditor_stylesheets_use); } }
- Status changed to Active
almost 2 years ago 10:11am 14 February 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Thanks! That should allow a test to be written! 🤓
Any chance you're interested in doing so? :D
- 🇬🇧United Kingdom jacobupal Leeds
While this is being worked on, is there a way to fix this in my theme?
- 🇦🇺Australia peterx
Installed Drupal 10.2.1 today. Claro as admin theme. Tried to set Ckeditor 5 for Full HTML. Could not. Had the message You have to configure Ckeditor 5. I noticed the message about fixing it using Claro. As an experiment, I used Olivero. That let me set Ckeditor 5 in Full HTML. I then switched back to Claro as the admin theme.
I then tried to create an article but Ckeditor would not appear for Full HTML using either Claro or Olivero.
I successfully added Ckeditor 5 to Basic HTML and the editor appeared in create Article.
I successfully added Ckeditor 5 to Restricted HTML and the editor appeared in create Article.I successfully added Ckeditor 5 to Full HTML but the editor did not appear in create Article. I tested several add/delete/add cycles with Claro and Olivero but could not make Ckeditor work with Full HTML.
This might help with diagnostics and testing.
I also tested with a third party theme for the site but not admin. When I add Ckeditor 5 to Basic or Full or Restricted, there is a message about the theme having a style sheet for Ckeditor but not Ckeditor 5.
"The 0 Point theme has ckeditor_stylesheets configured without a corresponding ckeditor5-stylesheets configuration. See the change record for details."
Using Firefox console during create Article, I get the following message for Basic, restricted, and Full.
Uncaught TypeError: node is null
checkMutation http://example.com/node/add/article line 612 > eval:92The line is:
node.nodeType === Node.ELEMENT_NODE &&
node.nodeName === 'SCRIPT' &&
node.dataset &&
node.dataset.bigPipeReplacementForPlaceholderWithId &&
typeof drupalSettings.bigPipePlaceholderIds[
node.dataset.bigPipeReplacementForPlaceholderWithId
] !== 'undefined',
);When I switch to Full, I get this additional error:
CKEditorError: plugincollection-soft-required {"missingPlugin":"LinkEditing","requiredBy":"EntityEmbedLinkUi"}
Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#erro... - 🇺🇸United States ChrisGrewe
If it helps anyone else, I found that setting the default admin theme to a specific theme rather than "default" gets you around this problem. The error arises when it loops through an array of themes expecting arrays of info, but none exists for "default".
- 🇨🇭Switzerland ytsurk Switzerland
When you have that javascript error mentioned here:
CKEditorError: plugincollection-soft-required {"missingPlugin":"LinkEditing","requiredBy":"EntityEmbedLinkUi"}
then enable the link Module and add a the link plugin to the CKEditor's toolbar,
see 🐛 CKEditor 5 plugin only works when the "Link" plugin is enabled Needs review