Problem/Motivation
Getting WSOD on /admin/config/content/formats/manage/[format id]
and /node/add/article and /node/*/edit
Error:
TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given en array_intersect() (linea 203 de /home/labagate/public_html/labagatela.org/web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php).
Steps to reproduce
1. Migrating from drupal 7 to drupal 10.09
2. Changing text format editor from Ckeditor 5 to nothing
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | d10.editor.editor.basic_html.yml | 869 bytes | anacolautti |
| #7 | d9.editor.editor.basic_html.yml | 919 bytes | anacolautti |
Comments
Comment #2
Augusto182 commentedComment #3
cilefen commentedThe steps to reproduce describe a normal activity so there must be more setup needed to reproduce the bug.
Also, please provide the backtrace.
Comment #4
wim leersAlso, which contrib modules did you install that provide CKEditor 5 plugins? It's likely that is the root cause.
Comment #5
anacolautti commentedIn case this helps anyone, we were having a similar error:
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).
Comment #6
wim leers@anacolautti Could you please share the exported text format + editor config entities from both before and after the re-saving? 🙏
Comment #7
anacolautti commentedHi @wim-leers. Sure, I hope this helps!
I believe this structure change
d9 settings:
to
d10 settings:
is what broke my site. The error line was this one:
web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.phpand the error, that the first argument of array_intersect could not be null
Comment #8
wim leersThanks, @anacolautti! Clarifying that this is no longer blocked.
Decreasing priority though because it seems very few people are running into this 😇
Comment #9
wim leersActually, … investigated right away, because I was too curious to find out how this could fail 🤓
Yes, you're right,
d9.editor.editor.basic_html.ymlis plain wrong: its settings are for CKEditor 4, not 5!Drupal cannot have done this itself. In #5 you wrote:
… that seems to have been the culprit.
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 🫣
Comment #10
catchI think this would have been prevented by #2628144: Ensure that ConfigImport is taking place against the same code base
Comment #11
wim leersThanks, @catch, TIL.
Comment #12
wim leersPer #8 and #10.
Comment #13
chicodasilva commentedRegarding this topic, just a small update.
I had a similar error and the root cause in our project was the config for "config/sync/editor.editor.webform_default.yml".
In our case, this configuration was not updated when we updated to ckeditor5, and after migrating to Drupal 10, we were having the error in this code:
web/core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php
Comment #14
granikJust in case, I've found a workaround.
Adding these lines into settings section of editor.editor.*.yml files fixed the issue for me:
Many thanks to @anacolautti.