Problem/Motivation
With the default_admin theme, going to add a node and trying to insert a media entity, the opened dialog with the media library contains the sidebar toggle that should only be on the main page, but never in dialogs.
Steps to reproduce
Proposed resolution
The issue must be in the hook form alter that injects extra components like that sidebar toggle, and it most likely doesn't handle the ajax request in this scenario, which needs to be fixed.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | Screenshot 2026-05-26 at 7.33.04 PM.png | 87.12 KB | bernardm28 |
| #9 | CleanShot 2026-05-26 at 19.29.38.png | 105.41 KB | bernardm28 |
| #2 | 2026-05-26_14-17.jpg | 49.2 KB | jurgenhaas |
Issue fork drupal-3590897
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:
- 3590897-sidebar-toggle-is
changes, plain diff MR !15876
Comments
Comment #2
jurgenhaasI can reproduce this issue with the latest 12.x branch which contains the first merge of the CSS consolidation. Here is what I get:
@mherchel can you please try that at your end again as well please?
Comment #3
mherchelYeah, my results are identical to you. The issue above is styling. Closing this as cannot reproduce
Comment #5
mherchelRe-opening. I can reproduce it.
Comment #6
jurgenhaasOK, here is what happens: it works correctly in the body field, i.e. when the media library opens inside ckeditor. But it doesn't work when this comes from a media reference field.
The difference is: the request from the body field comes with a
_wrapper_format=drupal_modalquery argument, while the media entity button calls in with_wrapper_format=drupal_ajax.In
\Drupal\default_admin\Hook\FormHooks::isModalOrOffcanvaswe determine whether special handling is required or not, and so far, Drupal ajax calls did require that handling. Just dialog and modal calls don't.This feels like an issue with the media reference call, not the theme. Let me do some more tests before I call that an issue elsewhere.
Comment #8
jurgenhaasAs sticky action buttons are not supported by the default admin theme for now, we don't need that special case and can treat all ajax requests the same. The attached MR fixes that and should be tested also by verifying that this is not causing any regressions.
Comment #9
bernardm28 commentedI can confirm this fixes the issue.

Without this patch the media window on a content type displays the sidenav button which lets you trigger an action behind that window.
The image below is how it looks after this patch.
That's more inline with i will expect that window to look without an extra button.
Comment #10
bernardm28 commentedComment #15
lauriiiThank you for fixing this!