- Issue created by @lawxen
- Merge request !643didn't work with theme switch if not as default admin theme → (Open) created by lawxen
- 🇩🇪Germany jurgenhaas Gottmadingen
Can you please explain what you mean by "the theme_switcher will not work right". What's required is a list of steps on how to reproduce the problem and an explanation what should have happened instead.
The changes in the MR would certainly have terrible side-effects, so that will not be merged. One reason being that the changes to
_gin_is_active()
would break the purpose of this method. It is there to determine if Gin is active, i.e. if Gin is configured to be either the frontend or the backend theme, or if it's the base theme of the current frontend or backend theme. The proposed change would just return TRUE if Gin is enabled, regardless of its usage.The changes in
GinSettings
would also deliver unexpected results. But reviewing the MR made me think whether we could simplify all those by removing all calls to$this->getAdminTheme()
and use a static stringgin
instead, because we always want the settings of Gin when either of those methods is being called. Unless we're dealing with a sub-theme of Gin, whereas sub-theming is not officially supported anyway.In any event, using
\Drupal::theme()
would be a no-go and requires dependency injection instead. - 🇨🇳China lawxen
@jurgenhaas Thanks for the detailed reply.
1. Gin is not friendly for subtheme
2. Gin/(Gin based Subtheme) not work with switch_theme →Reproduced step of 2:
- Install drupal11
- Install and enable switch_theme → ^2.1
- Enable Gin and configue it use dark mode (Not necessary, Just to see the problem more intuitively)
- Config path '/admin/content' use Gin or Gin based subtheme
- By deault admin theme is Claro, The page /admin/content didn't display right
- Config Gin as admin theme, The page /admin/content get right
- 🇨🇳China lawxen
One reason being that the changes to _gin_is_active() would break the purpose of this method.
I have revert the change _gin_is_active and add active theme check in it.