diff --git a/apps/theming/lib/Service/ThemesService.php b/apps/theming/lib/Service/ThemesService.php index 433555c980c74..39a8eeff41052 100644 --- a/apps/theming/lib/Service/ThemesService.php +++ b/apps/theming/lib/Service/ThemesService.php @@ -154,12 +154,15 @@ public function isEnabled(ITheme $theme): bool { * @return string[] */ public function getEnabledThemes(): array { + $enforcedTheme = $this->config->getSystemValueString('enforce_theme', ''); $user = $this->userSession->getUser(); if ($user === null) { + if ($enforcedTheme !== '') { + return [$enforcedTheme]; + } return []; } - $enforcedTheme = $this->config->getSystemValueString('enforce_theme', ''); $enabledThemes = json_decode($this->config->getUserValue($user->getUID(), Application::APP_ID, 'enabled-themes', '["default"]')); if ($enforcedTheme !== '') { return array_merge([$enforcedTheme], $enabledThemes); diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php index bd46ee4f7fc7e..3f0cc3e5d99dd 100644 --- a/core/templates/layout.public.php +++ b/core/templates/layout.public.php @@ -36,7 +36,9 @@ -
+ data-themes="">