[11.x] Remove the CKEditor 4 upgrade path

Created on 24 September 2021, almost 3 years ago
Updated 23 April 2024, 2 months ago

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 ๐Ÿ“Œ [11.x] Remove the CKEditor 4 upgrade path Fixed and #19

Remaining tasks

Delete:

  1. \Drupal\Tests\ckeditor5\Kernel\CKEditor4to5UpgradeCompletenessTest
  2. \Drupal\ckeditor5\Annotation\CKEditor4To5Upgrade
  3. \Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginInterface
  4. \Drupal\ckeditor5\Plugin\CKEditor4To5UpgradePluginManager
  5. \Drupal\ckeditor5\Plugin\CKEditor4To5Upgrade\Core
  6. \Drupal\ckeditor5\SmartDefaultSettings::createSettingsFromCKEditor4()
  7. Some test cases in \Drupal\Tests\ckeditor5\Kernel\SmartDefaultSettingsTest::provider()
  8. \Drupal\ckeditor5\CKEditor5StylesheetsMessage

User interface changes

None.

API changes

None.

Data model changes

None.

๐Ÿ“Œ Task
Status

Fixed

Version

11.0 ๐Ÿ”ฅ

Component
CKEditor 5ย  โ†’

Last updated about 6 hours ago

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupalโ€™s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the โ€œReport a security vulnerabilityโ€ link in the project pageโ€™s sidebar. See how to report a security issue for details.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    >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.

  • First commit to issue fork.
  • Merge request !6329Start deleting ckeditor4 โ†’ (Closed) created by quietone
  • Status changed to Needs work 5 months ago
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand

    I 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.

  • Pipeline finished with Failed
    5 months ago
    #82618
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Very 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 Drupal 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 ๐Ÿ˜Š

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Changing 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.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

    +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.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand
  • Pipeline finished with Failed
    5 months ago
    Total: 285s
    #82930
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Failing on PHPStan:

      139    Parameter $stylesheets_message of method                             
             Drupal\ckeditor5\Plugin\Editor\CKEditor5::__construct() has invalid  
             type Drupal\ckeditor5\CKEditor5StylesheetsMessage.                   
    

    Simple fix fortunately: that is just no longer necessary :)

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    10.3 has been branched. Does that mean this can land now? It's unlikely the affected will change in 10.3 too, so it's also unlikely that this'll make MRs more difficult to land?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    @Wim yes :)

  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Merged in upstream changes. Then finished what @quietone started: removed all traces of CKEditor5StylesheetsMessage.

  • Pipeline finished with Failed
    4 months ago
    Total: 479s
    #107096
  • Assigned to Wim Leers
  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    The test cases in SmartDefaultSettingsTest are now almost all stale/irrelevant: they're specifically testing an update from CKEditor 4, and that's no longer necessary.

    Because going forward, SmartDefaultSettings can and will only look at the HTML restrictions of the text format. Will tackle that next.

  • Pipeline finished with Failed
    4 months ago
    Total: 484s
    #107107
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    https://git.drupalcode.org/project/drupal/-/merge_requests/6329/diffs?co... got us down to 2 failing tests: SmartDefaultSettingsTest as 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.

  • Pipeline finished with Failed
    4 months ago
    Total: 483s
    #107157
  • Pipeline finished with Failed
    4 months ago
    Total: 476s
    #107172
  • Pipeline finished with Failed
    4 months ago
    Total: 531s
    #107184
  • Pipeline finished with Failed
    4 months ago
    Total: 514s
    #107203
  • Pipeline finished with Failed
    4 months ago
    Total: 611s
    #107807
  • Pipeline finished with Failed
    4 months ago
    Total: 530s
    #108081
  • Pipeline finished with Canceled
    4 months ago
    Total: 449s
    #108095
  • Status changed to Needs review 4 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    I recommend reviewing the test coverage changes using

    
    Only two <code>@todo

    s are left. This is 98% ready.

  • Pipeline finished with Failed
    4 months ago
    Total: 486s
    #108107
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    So long ckeditor4!

    Following to review later.

  • Pipeline finished with Failed
    4 months ago
    Total: 622s
    #108175
  • Pipeline finished with Failed
    4 months ago
    Total: 484s
    #108284
  • Issue was unassigned.
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    And now it will be green! ๐Ÿ˜„ Whew, this was quite a lot of work: to keep the good parts of SmartDefaultSettings that are still relevant now that CKEditor 4 is gone.

    Bumping to given the diffstat of +367, โˆ’1731.

  • Pipeline finished with Failed
    4 months ago
    Total: 2442s
    #108293
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Reran the javascript failing test multiple times but seems to consistently fail :(

  • Assigned to Wim Leers
  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Shoot!

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Ckeditor just doesn't want to go away!

  • Issue was unassigned.
  • Status changed to Postponed 4 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Merged in latest 11.x.

    The failure is reproducible locally:

    TypeError: Cannot read properties of null (reading 'length')
        at Object._parseSetting (http://localhost/subdirectory/core/modules/filter/filter.filter_html.admin.js?v=11.0-dev:310:39)
        at http://localhost/subdirectory/core/modules/filter/filter.filter_html.admin.js?v=11.0-dev:95:30
        at Array.forEach (<anonymous>)
        at Object.attach (http://localhost/subdirectory/core/modules/filter/filter.filter_html.admin.js?v=11.0-dev:90:9)
        at http://localhost/subdirectory/core/misc/drupal.js?v=11.0-dev:166:24
        at Array.forEach (<anonymous>)
        at Drupal.attachBehaviors (http://localhost/subdirectory/core/misc/drupal.js?v=11.0-dev:162:34)
        at http://localhost/subdirectory/core/misc/drupal.init.js?v=11.0-dev:32:12
        at HTMLDocument.listener 
    

    โ€ฆ but it'd be solved automatically by ๐Ÿ“Œ Deprecate core/modules/editor/js/editor.admin.js JS APIs in Drupal 10, for removal in Drupal 11 Fixed .

  • Pipeline finished with Failed
    4 months ago
    Total: 525s
    #112032
  • Assigned to Wim Leers
  • Status changed to Active 3 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Pipeline finished with Canceled
    3 months ago
    Total: 39s
    #124055
  • Pipeline finished with Success
    3 months ago
    Total: 521s
    #124057
  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium Wim Leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    All 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 on filter_html configuration), a few additions were necessary.

    You might question the need for that. Why:

    1. It makes it easy for existing text formats to adopt CKEditor 5
    2. It minimizes the changes to SmartDefaultSettingsTest
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Removal 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.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I 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.

  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Good point, forgot about the 2 year overlap

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    I 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!

    • catch โ†’ committed ec22f88c on 11.x
      Issue #3239012 by Wim Leers, quietone, smustgrave, xjm, catch, longwave...
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch
  • Status changed to Fixed 3 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    We'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 ๐Ÿ“Œ Remove redudundat hook_ENTITY_TYPE_presave() and ViewsConfigUpdater methods Active for that and some other issues when I tried to remove ckeditor5's overall 9-10.3 upgrade path.

  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone New Zealand
Production build 0.69.0 2024