Problem/Motivation
In Drupal 11, we should remove the upgrade path from CKEditor 4.
This means that in theory in Drupal 10 we should already deprecate \Drupal\ckeditor5\Annotation\CKEditor4To5Upgrade plugins … even though it's still necessary at that point. Perhaps we don't need to deprecate it, because in Drupal 11, this all becomes dead code anyway; everything must by definition have already been migrated to CKEditor 5 if it's running in Drupal 10?
Proposed resolution
Remove in Drupal 11 with no deprecation. See #18 and #19
Remaining tasks
Delete:
\Drupal\Tests\ckeditor5\Kernel\CKEditor4to5UpgradeCompletenessTest\Drupal\ckeditor5\Annotation\CKEditor4To5Upgrade\Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginInterface\Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginManager\Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade\Core\Drupal\ckeditor5\SmartDefaultSettings::createSettingsFromCKEditor4()- Some test cases in
\Drupal\Tests\ckeditor5\Kernel\SmartDefaultSettingsTest::provider() \Drupal\ckeditor5\CKEditor5StylesheetsMessage
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork drupal-3239012
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:
- 3239012-late-2023-deprecate
changes, plain diff MR !6329
Comments
Comment #2
wim leersComment #3
wim leers#3194084: Support functionality equivalent to ckeditor_stylesheets added an additional thing to be deleted in Drupal 11.
Comment #4
xjmRescoping. The code shouldn't be deleted; it should be simply moved to the CKEditor 4 module, which in turn gets moved to contrib.
Comment #5
xjmComment #6
xjmComment #7
xjmComment #8
wim leers@xjm You've rescoped this issue to be for Drupal 10, even though it was originally for Drupal 11. Even in the roadmap (#3238333: Roadmap to CKEditor 5 stable in Drupal 9), it says: .
That does not make sense: the CKEditor 4 module cannot provide an upgrade path for CKEditor 5 because:
SmartDefaultSettingsis also used to compute smart default settings for text formats using either no text editor or a text editor other than CKE4 — as described in #3226673: API addition: \Drupal\editor\Plugin\EditorPluginInterface::getDefaultSettings() should accept old Editor + Format to generate smart defaults, that's always a valuable capability to have, and is sorely missing for CKEditor 4 today.SmartDefaultSettings(the CKEditor 4-specific bits, see previous point: not everything in that class is related to CKEditor 4!) to live in a separate moduleSo, created #3270831: Make the CKEditor 4 → 5 upgrade path work even when the CKEditor 4 module is removed for this new scope.
Comment #9
xjmMoving to the D11 roadmap. We'll probably want to do this in late 2023 or early 2024, since that's when CKEditor's security coverage is probably going to end.
Comment #10
wim leers👍
Meanwhile, #3270831: Make the CKEditor 4 → 5 upgrade path work even when the CKEditor 4 module is removed is now ready for review — good news: managed to make it work with net less code than before 🤓🥳
Comment #11
wim leersThis sort of ties into #3304736: 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 — if the upgrade to Drupal 10 and CKEditor 5 is required to do before the update to Drupal 10, we can actually just remove the upgrade path in Drupal 10.
Except … that https://www.drupal.org/project/ckeditor is around, which allows CKEditor 4 to exist on Drupal 10. So I think that means the original outline (removing this in late 2023/early 2024) is still accurate.
Moving to
10.1.x. I'd move it to a further release if I could 🤓Comment #13
wim leers>14 months have passed since #11: it's now late 2023, tomorrow is December 1!
https://www.drupal.org/project/ckeditor will be unsupported soon.
Time to start exploring our options.
Comment #16
quietone commentedI was on the fence about deprecating or not but asked the other rms. Catch replied saying that in this it is ok to remove them. He pointed out that plugins are internal and these are a specific use case. Plus, since these will be in use for year or two, possibly three, it would be more disruptive to deprecate.
Based on that I started to remove files. I did remove some provider tests from SmartDefaultSettingsTest but there remains a lot of CkEditor4 strings in setup().
This will fails tests so settings to NW.
Comment #17
wim leersVery interesting, I sort of expected this to not happen 😅 Then again, sites can't go from Drupal 9 to 11 directly (i.e. no bypassing
startDrupal 10), so … it makes sense to do this.It triggers … Feels 😅 to be removing this — I spent a lot of time building this. And I built it for clean ejection when it was no longer needed, which is NOW, so it does feel kinda satisfying (cathartic?) to see how nicely this is removing ~1250 LoC (and more soon) 🤩
MR reviewed — I explained which other test cases (which you already alluded to, @quietone!) that are safe to remove can be identified 😊
Comment #18
catchChanging the issue title to indicate we'd only remove this in 11.x - this means sites that are still using ckeditor4 will be able to use the upgrade path on 10.x, which is going to be maintained until around 2026, years after ckeditor4's EOL.
The reason I think this would be more disruptive to deprecate than just remove outright in 11.x is because if we deprecate we either have to remove usages (which we wouldn't want to do in 10.x, there are still well over 100,000 Drupal 9.5 sites), or workaround the deprecation notices in tests etc., which is not really deprecating then. We offer 'best effort' bc and deprecations for internal code, and in this case the best we can do is none at all.
Comment #19
longwave+1 to no deprecations, but maintaining this throughout Drupal 10 and a clean removal in Drupal 11, given that sites already must go from 9 to 10 before they can go to 11. Sites using the CKE4 contrib module in Drupal 10 will have to complete their upgrade to CKE5 before moving to Drupal 11.
Comment #20
quietone commentedComment #21
quietone commentedComment #22
wim leersFailing on PHPStan:
Simple fix fortunately: that is just no longer necessary :)
Comment #23
quietone commentedComment #24
wim leers10.3 has been branched. Does that mean this can land now? It's unlikely the affected will change in
10.3too, so it's also unlikely that this'll make MRs more difficult to land?Comment #25
catch@Wim yes :)
Comment #26
wim leersMerged in upstream changes. Then finished what @quietone started: removed all traces of
CKEditor5StylesheetsMessage.Comment #27
wim leersThe test cases in
SmartDefaultSettingsTestare now almost all stale/irrelevant: they're specifically testing an update from CKEditor 4, and that's no longer necessary.Because going forward,
SmartDefaultSettingscan and will only look at the HTML restrictions of the text format. Will tackle that next.Comment #28
wim leershttps://git.drupalcode.org/project/drupal/-/merge_requests/6329/diffs?co... got us down to 2 failing tests:
SmartDefaultSettingsTestas predicted in #27, plus\Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5AllowedTagsTest::testSwitchToVersion5().I just pushed a commit that should make the latter pass, the commit message explains how/why.
Comment #29
wim leersI recommend reviewing the test coverage changes using
s are left. This is 98% ready.
Comment #30
smustgrave commentedSo long ckeditor4!
Following to review later.
Comment #31
wim leersAnd now it will be green! 😄 Whew, this was quite a lot of work: to keep the good parts of
SmartDefaultSettingsthat are still relevant now that CKEditor 4 is gone.Bumping to given the diffstat of
+367, −1731.Comment #32
smustgrave commentedReran the javascript failing test multiple times but seems to consistently fail :(
Comment #33
wim leersShoot!
Comment #34
smustgrave commentedCkeditor just doesn't want to go away!
Comment #35
wim leersMerged in latest
11.x.The failure is reproducible locally:
… but it'd be solved automatically by #2567801: Deprecate core/modules/editor/js/editor.admin.js JS APIs in Drupal 10, for removal in Drupal 11.
Comment #36
wim leers#2567801: Deprecate core/modules/editor/js/editor.admin.js JS APIs in Drupal 10, for removal in Drupal 11 landed!
Comment #37
wim leersAll green! 😄 🥳
90% of this MR is trivial.
The 10% that is non-trivial is in
SmartDefaultSettings. For it to continue to work (to provide default settings based on HTML restrictions of a text format, which 99% of the time means based onfilter_htmlconfiguration), a few additions were necessary.You might question the need for that. Why:
SmartDefaultSettingsTestComment #38
smustgrave commentedRemoval seems good. But question should this code be moved to the ckeditor4 contrib module?
I can imagine there are some still on ckeditor4 and they may upgrade to D11 while still trying to get to ckeditor5.
Comment #39
catchI think it's entirely reasonable to require people to update to ckeditor5 on Drupal 10 before going to Drupal 11, they've got until 2026 to do that and still be supported.
Comment #40
smustgrave commentedGood point, forgot about the 2 year overlap
Comment #41
catchI read through everything again and there was a few things I thought 'should we be deprecating this in 10.x first' and then I thought we don't want to deprecate it in 10.x because we want people to use it there to get onto ckeditor5, and then I re-read the issue and found us discussing the same thing already including me months ago and all the other release managers.
Committed/pushed to 11.x, thanks!
Comment #43
catchComment #44
catchComment #47
catchWe've still got a couple of ckeditor4 editor config exports supporting various tests, which I think possibly might not be for actual ckeditor4 upgrade path testing at all, but in which case should probably be renamed. Opened #3442395: ckeditor5 and editor module test config exports/stubs rely on hook_editor_presave() bc layers for that and some other issues when I tried to remove ckeditor5/editors's overall 9-10.3 upgrade path.
Comment #48
quietone commentedComment #51
quietone commentedUpdate version to the branch this applies to.