From 88b5f7e340cafe3be0a65f3eb18683fd898ff5e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?John=20Molakvo=C3=A6?= Date: Thu, 26 Jan 2023 19:52:16 +0100 Subject: [PATCH] fix(theming): fix admin-disabled background and user pristine theming settings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/theming/lib/Themes/CommonThemeTrait.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/theming/lib/Themes/CommonThemeTrait.php b/apps/theming/lib/Themes/CommonThemeTrait.php index 360c335fc7d..799d03e34e8 100644 --- a/apps/theming/lib/Themes/CommonThemeTrait.php +++ b/apps/theming/lib/Themes/CommonThemeTrait.php @@ -131,6 +131,7 @@ trait CommonThemeTrait { && $this->appManager->isEnabledForUser(Application::APP_ID)) { $themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default'); $currentVersion = (int)$this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0'); + $globalBackgroundDeleted = $this->config->getAppValue(Application::APP_ID, 'backgroundMime', '') === 'backgroundColor'; // The user uploaded a custom background if ($themingBackground === 'custom') { @@ -153,12 +154,19 @@ trait CommonThemeTrait { // The user picked a static colour if (substr($themingBackground, 0, 1) === '#') { return [ - '--image-background' => 'no', + '--image-background-plain' => 'true', '--color-background-plain' => $this->themingDefaults->getColorPrimary(), ]; } - } + // Admin disabled the background and the user + // did not customized anything + if ($globalBackgroundDeleted) { + return [ + '--image-background-plain' => 'true', + ]; + } + } return []; } } -- 2.39.5