From 2a4b80ce68f5db4c0365054dd471414ae0871118 Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Mon, 2 Feb 2026 14:16:18 -0300 Subject: [PATCH 1/2] fix(theming): display error messages on image upload and delete previous image only after validation Signed-off-by: Cristian Scheid --- apps/theming/lib/ImageManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php index 309bf192bc3f0..8ba558d7947a8 100644 --- a/apps/theming/lib/ImageManager.php +++ b/apps/theming/lib/ImageManager.php @@ -202,8 +202,6 @@ public function delete(string $key): void { } public function updateImage(string $key, string $tmpFile): string { - $this->delete($key); - try { $folder = $this->getRootFolder()->getFolder('images'); } catch (NotFoundException $e) { @@ -217,6 +215,8 @@ public function updateImage(string $key, string $tmpFile): string { throw new \Exception('Unsupported image type: ' . $detectedMimeType); } + $this->delete($key); + if ($key === 'background') { if ($this->shouldOptimizeBackgroundImage($detectedMimeType, filesize($tmpFile))) { try { From 363e6b2f50352882789a3086217de13fbcca1d14 Mon Sep 17 00:00:00 2001 From: Cristian Scheid Date: Tue, 3 Feb 2026 15:20:29 -0300 Subject: [PATCH 2/2] refactor(theming): use isAxiosError for error handling Signed-off-by: Cristian Scheid