Problem/Motivation
While the D9->D10 update will be smooth and transparent, switching from CKEditor (4) to CKEditor 5 in Drupal 9 results in a very informative but slightly overwhelming set of messages.
Steps to reproduce
Install Standard profile
Install and enable CKEditor 5 module
Go to Configuration -> Content Authoring -> Text formats and editors
Configure the Basic HTML format
Switch the "Text editor" select list from CKEditor to CKEditor 5

Proposed resolution
TBD
One suggestion was to link to the /admin/help/ckeditor5 page, especially to help explain CKE plugins.
The current messages
In CKEditor 5, configuring “Allowed HTML Tags” is no longer an independent config step. The allowed tags directly correspond to which CKEditor 5 plugins are enabled and how those plugins are configured.
When switching a text format to CKEditor 5, the format’s configuration is analyzed and plugins+config are automatically configured to settings that ensure zero data loss. There are several scenarios covered by this process.
No messages are displayed for 1:1 mappings of CKEditor 4 toolbar buttons to CKEditor 5 toolbar items. Because for these, there is nothing to point out to the user: if it looks and functions the same, there’s no need to inform the user.
If
or
are not allowed in the original format
These tags are automatically added since they are essential to CKEditor 5 functioning.
The following tag(s) were added to Limit allowed HTML tags and correct faulty HTML, because they are needed to provide fundamental CKEditor 5 functionality : @missing_tags.
When CKEditor 5 plugins are enabled in order to support tags supported in original format.
If available, CKEditor 5 plugins that support these tags/attributes are automatically enabled. For example if <table> is supported, the CKEditor 5 table plugin is automatically enabled. This is a general message stating the plugins that were enabled. It is accompanied by additional messages detailing the specific reason a plugin was enabled.
The following plugins were enabled to support tags that are allowed by this text format: %enabling_message_content.
Tags supported from original format not supported by available CKEditor 5 plugins
If an allowed tag is not supported by any CKEditor 5 available plugin, the “Source Editing” plugin is added and the tag/attribute is added to its list of “Manually editable HTML tags”
The following tags were permitted by this format's filter configuration, but no plugin was available that supports them. To ensure the tags remain supported by this text format, the following were added to the Source Editing plugin's Manually editable HTML tags: @unsupported_string.
When CKEditor 5 plugins are enabled in order to specifically support attributes (not tags) supported in original format.
The following plugins were enabled to support specific attributes that are allowed by this text format: %enabled_for_attributes_message_content.
Attributes supported by original text format not supported by available CKEditor 5 plugins
If an allowed attribute is not supported by any CKEditor 5 available plugin, the “Source Editing” plugin is added and the attribute (with the tags it is associated with) is added to its list of “Manually editable HTML tags”
This format's HTML filters includes plugins that support the following tags, but not some of their attributes. To ensure these attributes remain supported by this text format, the following were added to the Source Editing plugin's Manually editable HTML tags: @missing_attributes.
Remaining tasks
TBD
User interface changes

The warning message about missing Claro and Olivero styles will be addressed by #3285054: Add ckeditor5-stylesheets: false to Claro and Olivero (and fix it 😅).
API changes
N/A
Data model changes
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | interdiff_44-47.txt | 2.37 KB | bnjmnm |
| #47 | 3245967-47-95x-10x-101x.patch | 82.97 KB | bnjmnm |
| #47 | 3245967-47-94x.patch | 83.43 KB | bnjmnm |
| #44 | interdiff_41-44.txt | 7.04 KB | bnjmnm |
| #44 | 3245967-44-94x.patch | 83.61 KB | bnjmnm |
Issue fork drupal-3245967
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wim leersComment #3
wim leersComment #5
wim leers#3273325: CKE5 and contrib: better "next action" description on upgrade path messages landed and has made a big improvement to the usability/scannability/interpretability of these messages 🥳
Comment #6
bnjmnmComment #7
bnjmnmI brought this issue to last weeks UX meeting #3275459: Drupal Usability Meeting 2022-04-22. There is a recording with the full discussion, and I'll summarize what I believe to be the key takeaways.
Comment #15
bnjmnmAdding UX meeting credits
Comment #16
bnjmnmComment #17
wim leers+1 → this is what the plan has been all along for the actual upgrade path (a
hook_update_N()orpost-update.phpimplementation) that will get executed during the9.y.x→10.0.xupdate: because there is no UI to show these messages anyway.Interesting suggestion! Seems feasible. Just checking: would this be a problem for accessibility?
Right — that'd be ideal. The devil will be in the details.
Curious to see what the actual implementation will do here! 🤓 It feels like you have a good grasp on what needs to happen, and perhaps have a vision you want to realize, @bnjmnm?
Comment #18
wim leersComment #19
bnjmnmI received great feedback at the UX meeting, and wanted to come up with a solution that integrated as much of it as possible.
The current (longer) messages will be written to logs
This information could still be valuable so a subset of users, but those users will not likely mind going to logs to learn more.
Leverage the help page at
admin/help/ckeditor5to provide additional details for those who want themThe messages will be informative enough that a user can determine if they want a more thorough explanation, and those explanations will be on the help page that comes with the module, and linked via the status/warning message.
One consolidated status message
Something along the lines of...
The linked "help:" sections are ones that would be created as part of this issue
One consolidated warning message
The linked "help:" sections are ones that would be created as part of this issue
Not sure if that's the most intuitive way to represent links to theoretical paths or conditional text but that's my attempt 🙂
Comment #20
wim leersI really like your proposal! 🤩 Let's implement it? 😄
Comment #21
hooroomooI think it could be helpful too if the logs were linked to the "Additional details are available in your logs" so they can be easily accessed/makes that option more visible
Comment #22
catchWe've done this with a
if (...moduleExists('dblog'))before, if someone's using a different logger they're on their own, but works for enough people and avoids linking to nothing.Comment #24
bnjmnmComment #25
wim leersPhenomenal difference:
👏
Posted a review on the merge request, but keeping this marked as needing review to invite others to review as well :)
Comment #27
nod_+1 to the new messages. Should the warning be above the status message? As-is they are closer to the actionable area so I can see why it's below, hopefully people don't stop at the green message :)
I do have one significant issue with the current patch: using formatPlural to do conditional display of links is a bit too clever I'm afraid (I can still hear the screams of translators I used to work with :).
What happens when the plural formula for the language is not "singular/plural" such as arabic which ones should be translated in that case?
I think we should have properly separated strings for that, the different string versions don't convey the fact that it's singular/plural, it's about another condition, not cardinality. It will trip up translators.
Comment #28
bnjmnmGood call on #27 that was a use of formatPlural I hadn't considered.
Comment #29
nod_I've noticed the watchdog messages are written to the log before the text format is saved. As soon as we select the cke5 element from the select in the text format config, the messages are written, even if we don't save the text format form. If the user is on the page, select the CKE5 option see the message about the logs, gets curious and click on the link to see the logs he'll be moved away from the configuration page and will essentially lose theirs config (if we assume back button won't work in all cases). They'll go back to the config page, reselect CKE5, see new messages and new log entries will be written so if he looks at the log at that moment they'll have: No CKE5 editor configured, 2 sets of log messages about changing CKE configuration. Not sure what do do about that, probably not too big a deal since it's a pretty low-traffic area anyway.
If we have a bunch of formats it would be helpful to replace "This format's HTML filters" in the log messages by the actual format name because this is ambiguous when seen out of context.
Comment #30
bnjmnmDiscussed this with @Wim Leers, MR implements what we decided + a hefty reroll.
Comment #31
xjm@bnjmnm suggested that we should consider addressing minor issues in followups given the difficulty of keeping this rerolled/updated, and I agree. So things like code comments, minor API cleanups, and iteration on the phrasings of the UI messages can happen in followup issues, and we'll decide which of those issues are stable-blocking on a case-by-case basis. Thanks!
Comment #32
wim leers👍
Comment #33
nod_single minor comment on an
andstring that isn't translatable (and we can probably replace by ",") other than that, good for me :)Comment #34
lauriiiI think the untraslatable "and" is something that warrants moving this to needs work. Maybe it could be replaced by a comma like proposed by @nod_.
Comment #35
catchComma seems fine to me given this is concatenation within a placeholder, pretty sure we do similar elsewhere.
Comment #36
bnjmnmSwitching to NR - the three remaining threads in the MR are all about the same thing. I have some additional info that may help us get to a solution?
Comment #37
xjmComment #38
bnjmnmComment #39
nod_FormattableMarkup is better, nice one lauriii :)
This works for me :)
Comment #40
lauriiiComment #41
spokjeLooks like
3245967-38-95x_100x_101x.patchneeds a rerollComment #42
bnjmnmrerolls
Comment #43
lauriiiI realized that we should also use the formattable markup for the logger messages since we don't usually want to make the logger messages translatable.
Comment #44
bnjmnmAddresses #43 + needed rerolling anyway.
Comment #45
nod_👍
Comment #46
lauriiiThese two messages are printed as UI messages so they should be translated. 😅
Comment #47
bnjmnmSince it's a small interdiff, I got a +1 from @lauriii to switch back to RTBC on this change.
Comment #52
lauriiiCommitted b6f4e50 and pushed to 10.1.x. Also backported to 10.0.x, 9.5.x and 9.4.x. Thanks!