Gin does not render properly if set as active theme from a custom theme negotiator

Created on 2 August 2025, 14 days ago

Problem/Motivation

If you have Gin installed but not set as the administration theme, and write a custom `theme_negotiator` to set the administration theme to gin, gin does not render correctly, and is unusable.

There's a lot that should be happening but isn't, but at the very least, the `_gin_is_active()` returns false when it should be true.

Steps to reproduce

  1. Install a new version of Drupal 11
  2. Download and install Gin
  3. Create a custom module with a theme_negotiator to set the theme to `gin` if the route is an admin route
  4. Ensure claro is the default admin theme
  5. Visit a page that should be in the admin theme. It is unusable.

Screenshots:

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

5.0

Component

Code

Created by

🇺🇸United States miwayha

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @miwayha
  • 🇨🇭Switzerland saschaeggi Zurich

    I'm closing this as won't fix. We only support setting Gin as the default theme.

    Best regards

  • 🇺🇸United States miwayha

    I wasn’t able to find that in the documentation.

    Given that theme negotiators are part of Drupal core, can you please add this to the list of known issues?

    I’d really like for Gin to be compatible with Drupal core. Would you please consider reopening this as a feature request?

  • 🇨🇭Switzerland saschaeggi Zurich

    We're in the process of preparing Gin to be moved into Core, replacing Claro.

    There are plans that in the future there will be no option to change the admin theme anymore. Given those circumstances, we won't further explore this.

    ThemeNegotiators was more built with frontend themes in mind. Gin has some specialities which is beyond what Core imagined what an (admin) theme would provide.

    I hope this helps

  • 🇺🇸United States miwayha

    Ok it is helpful, thank you. I’m aware that Gin will be the new default admin theme.

    At this point, I’m just asking for any of the rest of this to be documented anywhere. I’m not seeing this mentioned in the current Gin documentation.

    I’ve spent some time looking at the theme negotiator stuff on api.drupal.org, and I can’t find a mention that theme negotiators should only be used for front end themes.

    I’m also having trouble finding an issue describing plans to disable admin theme configuration in future versions of Drupal. I would really be interested in reading that context.

    This is all great info: I’m just asking that it be written down somewhere, or somewhere more discoverable than its current location.

Production build 0.71.5 2024