Skip to content

Commit 13fdb06

Browse files
authored
Merge pull request #36394 from nextcloud/stable25-fix-theming-bg-disabled
[stable25] fix admin-disabled background and user pristine theming settings
2 parents 382efb0 + 88b5f7e commit 13fdb06

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

apps/theming/lib/Themes/CommonThemeTrait.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ protected function generateUserBackgroundVariables(): array {
131131
&& $this->appManager->isEnabledForUser(Application::APP_ID)) {
132132
$themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default');
133133
$currentVersion = (int)$this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0');
134+
$globalBackgroundDeleted = $this->config->getAppValue(Application::APP_ID, 'backgroundMime', '') === 'backgroundColor';
134135

135136
// The user uploaded a custom background
136137
if ($themingBackground === 'custom') {
@@ -153,12 +154,19 @@ protected function generateUserBackgroundVariables(): array {
153154
// The user picked a static colour
154155
if (substr($themingBackground, 0, 1) === '#') {
155156
return [
156-
'--image-background' => 'no',
157+
'--image-background-plain' => 'true',
157158
'--color-background-plain' => $this->themingDefaults->getColorPrimary(),
158159
];
159160
}
160-
}
161161

162+
// Admin disabled the background and the user
163+
// did not customized anything
164+
if ($globalBackgroundDeleted) {
165+
return [
166+
'--image-background-plain' => 'true',
167+
];
168+
}
169+
}
162170
return [];
163171
}
164172
}

0 commit comments

Comments
 (0)