[regression] Class is not added to MediaLibrary dialog

Created on 12 September 2024, 3 months ago

Problem/Motivation

This regression is a result of 📌 Removal :tabbable usage in dialog.js Fixed

Styling and javascript that relies on a CSS selector is broken on the Media Library CKEditor widget. This is because the class media-library-widget-modal is missing on the dialog container element.

While this change was also applied to Drupal 10.3.x it seems to only effect Drupal 11. I'm guessing whatever consumes that config file changed in a way that broke it.

The code change: https://git.drupalcode.org/project/drupal/-/commit/94bfd9fa39f244877b320...

If I revert this changed line in ckeditor5.ckeditor5.yml back to the following then the class is injected properly again.
dialogClass: media-library-widget-modal

Steps to reproduce

Drupal 11, go to a CKEditor input with the Embed Media plugin enabled. Click the Add Media button.

Proposed resolution

To be determined

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
CKEditor 5 

Last updated 2 days ago

Created by

🇺🇸United States rhovland Oregon

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

    It restores functionality that was present in earlier versions.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @rhovland
  • 🇮🇳India sourav_paul Kolkata

    I've tested it on D11.0.1 using the mentioned steps.
    verified that the class "media-library-widget-modal" is attached.

    Sharing SS for reference:

  • 🇺🇸United States rhovland Oregon

    Hmm I wonder what is different then? I ran into this with a fresh install of Drupal 11 using the recommended composer template. I installed the umami profile. I also switched to Olivero in case there was something theme specific going on there.

    On my actual production site which is on 10.3.x where the change had already taken place I don't experience this bug.

    Did you test this on a new install or an existing site?

  • 🇮🇳India sourav_paul Kolkata

    I tested it on new D11 instance.

  • 🇮🇳India sourav_paul Kolkata

    @rhovland have you retested the issue?

  • 🇺🇸United States rhovland Oregon

    I just tested it again. This time using the standard profile. Enabled the media module, added the embed media button to the basic text format.

    Created a new basic page. Clicked the add media button. Class media-library-widget-modal is missing.

  • 🇺🇸United States keiserjb

    I had found another issue talking about this. I had noticed on my Drupal 11 site that the media library modal was narrower than in Drupal 10. I then found the missing class.

  • 🇺🇸United States keiserjb

    Changing the line in ckeditor5.ckeditor5.yml certainly fixes the problem.

    I also tried adding the class in MediaLibrary.php. This worked too.

    // Making the title for editor drupal media embed translatable.
        $static_plugin_config['drupalMedia']['dialogSettings'] = [
          'title' => $this->t('Add or select media'),
          'classes' => ['media-library-widget-modal'],
        ];
  • 🇺🇸United States rhovland Oregon

    Looks like this affects other users as well but only some of them.

  • First commit to issue fork.
  • Merge request !10595Update file ckeditor5.ckeditor5.yml → (Open) created by Unnamed author
  • 🇺🇸United States mckinzie25

    This is a patch applying the change suggested in the original ticket. It restores the line

    dialogClass: media-library-widget-modal
    

    to ckeditor5.ckeditor5.yml.

Production build 0.71.5 2024