Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Update to CKEditor5 v31.1.0 in core: https://github.com/ckeditor/ckeditor5/releases/tag/v31.1.0
Key changes we need (besides the many bugfixes we benefit from):
- https://github.com/ckeditor/ckeditor5/issues/10828:
image: Manual decorators on the linked inline images should be preserved while loading editor content. Closes #10828. (commit)
→ this unblocks #3247683: Disable CKEditor 5's automatic link decorators (in Drupal filters should be used instead), which is a major issue - https://github.com/ckeditor/ckeditor5/issues/8510:
core: Support language configuration passed in defaultConfig option through editor's constructor. Closes #8510. (commit)
→ this might fix #3250191: Translation of toolbar button tooltips not working when text part language plugin is enabled
Proposed resolution
core/package.json
cd core
yarn install
yarn run vendor-update
yarn run build:ckeditor5
Remaining tasks
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
CKEditor 5 asset library updated to version 31.1.0.
Issue fork drupal-3258250
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
hooroomooComment #4
cilefen CreditAttribution: cilefen commentedBecause updating ckeditor in the past has been a very specific process, and because this looks like the first update to ckeditor5 in this codebase, can you write a few words about how you built the library? Also, I don't see core/core.libraries.yml changing in this diff.
Comment #5
Wim LeersBasically: update
core/package.json
,yarn install
,yarn run vendor-update
,yarn run build:ckeditor5
. So: for CKE5 the process is 99% identical to any other JS package.Indeed! @nod_, looks like
vendor-update
didn't updatecore/libraries.yml
?Or … @hooroomoo, any chance you didn't run that yet maybe? 🤓
Comment #7
hooroomooSo I tried again on a second branch and did the same steps I did the first time that are listed in #5 and I'm still not seeing the core/core.libraries.yml updated for me.
Having @nod_ take a look tomorrow.
Comment #8
hooroomooComment #9
Wim LeersNote: this blocks #3247683: Disable CKEditor 5's automatic link decorators (in Drupal filters should be used instead).
👍 because:
window.CKEDITOR_VERSION
now returns'31.1.0'
31.1.0
are in code comments'@see
links.👎 because:
yarn run vendor-update
did now updatecore/core.libraries.yml
thanks to @hooroomoo's bugfix … but it only updated thecore/ckeditor5
library, not the dozens others:core/ckeditor5.editorClassic
,core/ckeditor5.specialCharacters
,core/ckeditor5.list
, et cetera.This suggests that we should do #3249698: Simplify CKEditor 5 asset library metadata after all? 🤔 If we landed that first, then this MR would not need to manually update all those lines!
Comment #10
nod_Comment #11
Wim LeersThe
core/scripts/js/assets.js
change will land in #3258371: fix yarn vendor-update command.Comment #12
Wim LeersComment #13
lauriii#3258371: fix yarn vendor-update command has been committed.
Comment #14
Wim LeersComment #15
Wim LeersIt's a holiday in the U.S., so:
9.4.x
into MR to avoid it doing what #3258371: fix yarn vendor-update command already did:git fetch && git merge origin/9.4.x
, then commit the result (no conflicts to resolve).3258250-10
), like so:This means I ported the crucial changes from the 9.4.x MR, and they applied cleanly. 👍
Now I need to rebuild everything for
10.0.x
:and then commit & push it.
So, I didn't make any changes, just ran the same commands again. Just to be safe. Because I thought there would not be differences, but theoretically due to different
package.json
s it'd have been possible:Fortunately, in practice, that's not the case … except that CKE5 in the
10.0.x
branch was apparently missing one translation file:That's the only difference.
Most importantly, there is an empty diff for the
yarn.lock
file:Thanks to this adding that missing translation file, it should once again be possible to have a single MR/patch apply to all branches (
9.3.x
,9.4.x
and10.0.x
) in the future for CKEditor 5. 👍I did not do any significant work on this, just mechanics, so I'm able to RTBC this.
Comment #17
Wim LeersThis was the sole failure for the
10.0.x
test:I expect the currently running test to pass. That failure cannot have been caused by this MR.
Comment #22
lauriiiCommitted 3560d07 and pushed to 10.0.x. Also committed the Drupal 9 MR to 9.4.x. Thanks!
Comment #23
Wim LeersYay! That unblocked: