Problem/Motivation

Media Library integrates with both CKEditor 4 and CKEditor 5. CKEditor 4 will be deprecated and removed from core in Drupal 10, so Media Library's integrations should be owned by the CKEditor module instead of the Media Library module.

Proposed resolution

Move all of the integration code from Media Library to CKEditor:

  1. Review plugin in core/modules/medialibrary/js/plugins/drupalmedialibrary (appears to have CKEditor 4 integration) and move as appropriate
  2. Move Drupal\media_library\Plugin\CKEditorPlugin to CKEditor's namespace and update accordingly. (Deprecate the old version.)
  3. Look at core/modules/media_library/src/MediaLibraryEditorOpener.php which mentions CKEditor in the text. Maybe just say "text editor integration"?
  4. Move the following tests to CKEditor's namespace:
    • core/modules/media_library/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
    • core/modules/media_library/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
  5. Move integration code from media_library.module to (e.g.) ckeditor.module.

There is a diffstat of potential Media Library integration code to remove but it only removes the code, rather than moving it to CKEditor 4 and updating namespaces/etc.

Do not alter any CKEditor 5 Media Library integration.

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Issue fork drupal-3271057

Command icon 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

xjm created an issue. See original summary.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

wim leers’s picture

Version: 9.5.x-dev » 9.4.x-dev
Assigned: Unassigned » wim leers

wim leers’s picture

Status: Active » Needs review

Quoting \Drupal\media\Plugin\CKEditorPlugin\DrupalMediaLibrary:

 * @internal
 *   Plugin classes are internal.

👍 (So we can move this into the CKEditor module without breaking BC.)

wim leers’s picture

Status: Needs review » Needs work

Some very clear failures I'll need to figure out.

wim leers’s picture

Assigned: wim leers » Unassigned
Status: Needs work » Needs review

Should be green now!

wim leers’s picture

I can smell the RTBC 😜

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Did few searches and went through all of the media library files quickly to make sure we didn't miss anything. I think this is all good now!

  • catch committed d07d94c on 10.0.x
    Issue #3271057 by Wim Leers, xjm, lauriii: Move Media Library CKEditor 4...
  • catch committed 13051c3 on 10.1.x
    Issue #3271057 by Wim Leers, xjm, lauriii: Move Media Library CKEditor 4...
catch’s picture

Version: 9.4.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, cherry-picked to 10.0.x and 9.5.x, thanks!

  • catch committed 3941fd0 on 9.5.x
    Issue #3271057 by Wim Leers, xjm, lauriii: Move Media Library CKEditor 4...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.