diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-02-11 13:58:37 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-02-11 13:58:37 +0100 |
| commit | 0edd963f21bcbfe3f5628d76ff94a281501a9a96 (patch) | |
| tree | 319ca3aa76cf552fac1aa7758a7bacbb2fe3a672 /lib/classes/JsonApi/Routes/Themes | |
| parent | 7dc2d3e1266810b98758faeaf3bd4dcab04330ce (diff) | |
delete theme asset upon theme deletion, allow activation regardless of other themes state and some small touchups, fixes #6244biest-6244
Diffstat (limited to 'lib/classes/JsonApi/Routes/Themes')
| -rw-r--r-- | lib/classes/JsonApi/Routes/Themes/ThemesUpdate.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/classes/JsonApi/Routes/Themes/ThemesUpdate.php b/lib/classes/JsonApi/Routes/Themes/ThemesUpdate.php index 751b0d0..c1fcc6b 100644 --- a/lib/classes/JsonApi/Routes/Themes/ThemesUpdate.php +++ b/lib/classes/JsonApi/Routes/Themes/ThemesUpdate.php @@ -35,13 +35,17 @@ class ThemesUpdate extends JsonApiController if (self::arrayGet($json, 'data.attributes.active') === true) { $activeThemes = \Theme::getActiveThemes(); foreach ($activeThemes as $theme) { - if ($theme->id !== $resource->id && $theme->type === $resource->type) { + if ( + $theme->id !== $resource->id + && $theme->type === $resource->type + ) { $theme->active = false; $theme->store(); - $resource->active = true; - $resource->store(); } } + + $resource->active = true; + $resource->store(); } return $this->getContentResponse($resource); @@ -77,10 +81,10 @@ class ThemesUpdate extends JsonApiController $resource->$sormKey = $val; } } - + $resource->store(); return $resource; } -}
\ No newline at end of file +} |
