- 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?
- 🇺🇸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.
- 🇺🇸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.
- Status changed to Needs review
5 months ago 8:54am 6 February 2025 - Status changed to Needs work
5 months ago 6:29pm 9 February 2025 - 🇮🇳India dhirendra.mishra
Patch is working for me as well. but not sure why class - ui-dialog-narrow is added here when used in ckeditor
while using media field out of ckeditor does not have this class ? do we also want to remove this class ? if no then may i know what is the use of this ? - 🇬🇧United Kingdom catch
We don't have visual regression testing in core so I'm not sure how we'd add test coverage for this, tagging for manual testing though.
- 🇺🇸United States smustgrave
We can't add a test to verify the existence of a class?
- 🇺🇸United States smustgrave
Seems to be consistently having a test failure though.
- 🇧🇪Belgium herved
I can confirm the issue as I stumbled on this after upgrading to D11.
It's very easy to reproduce with demo_umami profile and opening the add media modal from ckeditor.
I just did a git bisect on the 11.x branch and
66c3914d39bf24d828ec8516389d7cadad52294e is the first bad commit and indeed comes from 📌 Removal :tabbable usage in dialog.js Fixed - Merge request !12597[regression] Class is not added to MediaLibrary dialog. → (Open) created by herved
- 🇧🇪Belgium herved
Created new MR, the actual fix is in
OpenDialogCommand::__construct
- 📌 Removal :tabbable usage in dialog.js Fixed was committed to 10.3.x and 11.x but their commit differs, mainly inOpenDialogCommand::__construct
where the issue lies in 11.x, because if$dialog_options['dialogClass']
is set (it is via ckeditor5.js), then$dialog_options['classes']['ui-dialog']
is not taken into account.
- this MR contains improvements in order to ensure both$dialog_options['classes']['ui-dialog']
and$dialog_options['dialogClass']
are taken into account/preserved.
- 10.3.x is not affected by this bug per-se because it does preserve$dialog_options['classes']['ui-dialog']
, however it could (should IMO) be ported as well, for consistency.
- I took the opportunity to align the way this is handled in OpenDialogCommand and OpenOffCanvasDialogCommand
- Added some regression tests for those + test to ensure themedia-library-widget-modal
class is present on the ckeditor media library modal.