- Issue created by @Augusto182
- Status changed to Postponed: needs info
over 1 year ago 2:35am 14 July 2023 The steps to reproduce describe a normal activity so there must be more setup needed to reproduce the bug.
Also, please provide the backtrace.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Also, which contrib modules did you install that provide CKEditor 5 plugins? It's likely that is the root cause.
- 🇩🇪Germany anacolautti
In case this helps anyone, we were having a similar error:
TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given in array_intersect() (line 203 of web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php
In our case, it happened because we updated our site to Drupal 10 but the configuration remained unchanged from our Drupal 9 previous version of the site. Then, the config element of the editor had a different structure that the CKEditor5PluginManager could not iterate.
We solved it by either editing and saving the text format again at /admin/config/content/formats, or deleting the faulty text format and creating it again (where the previous solution was not possible).
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
@anacolautti Could you please share the exported text format + editor config entities from both before and after the re-saving? 🙏
- 🇩🇪Germany anacolautti
Hi @wim-leers. Sure, I hope this helps!
I believe this structure change
d9 settings:
settings toolbar rows
to
d10 settings:
settings toolbar items
is what broke my site. The error line was this one:
web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php
if (empty(array_intersect($editor->getSettings()['toolbar']['items'], array_keys($definition->getToolbarItems())))) { unset($definitions[$plugin_id]); }
and the error, that the first argument of array_intersect could not be null
- Status changed to Active
about 1 year ago 4:35pm 19 September 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Thanks, @anacolautti! Clarifying that this is no longer blocked.
Decreasing priority though because it seems very few people are running into this 😇
- Status changed to Postponed: needs info
about 1 year ago 4:43pm 19 September 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Actually, … investigated right away, because I was too curious to find out how this could fail 🤓
Yes, you're right,
d9.editor.editor.basic_html.yml
is plain wrong: its settings are for CKEditor 4, not 5!Drupal cannot have done this itself. In #5 you wrote:
We solved it by either editing and saving the text format again at /admin/config/content/formats, or deleting the faulty text format and creating it again (where the previous solution was not possible).
… that seems to have been the culprit.
In our case, it happened because we updated our site to Drupal 10 but the configuration remained unchanged from our Drupal 9 previous version of the site. Then, the config element of the editor had a different structure that the CKEditor5PluginManager could not iterate.
How did you go from Drupal 9 to 10? From which exact version to which exact version? Was https://www.drupal.org/project/ckeditor → installed?
There are very explicit instructions during the update from 9 to 10. Although #3304736-43: Provide a good UX to ensure the CKEditor 4 to 5 update is always done before upgrading to Drupal 10 unless the contrib module is installed → unfortunately never landed, and that would've made it more clear still 🙁 I definitely tried to convince core committers! 😅
So … I'm afraid I once again need more detail to actually be able to harden against this 🫣
- 🇬🇧United Kingdom catch
I think this would have been prevented by #2628144: Ensure that ConfigImport is taking place against the same code base →
- Status changed to Closed: duplicate
10 months ago 10:29am 13 February 2024