nextcloud/apps/theming/tests
Anna Larch 638b2c20c6 fix(theming): fix broken custom images introduced by #58224
PR #58224 introduced a raster→SVG conversion path in ImageManager::getImage()
that breaks display of custom theming images. The root cause is a three-part
bug chain:

1. getImage() attempted to convert raster images (PNG/JPEG) to SVG format,
   which Imagick cannot do meaningfully and produces broken output.
2. getMimeType() returns 'application/octet-stream' for extensionless stored
   files, so the Content-Type response header was wrong.
3. Stale .svg cache files persisted after image replacement, causing
   subsequent requests to serve the wrong format.

Fix by:
- Restricting the Imagick conversion to SVG→PNG only (not raster→SVG)
- Reading the stored MIME type from IAppConfig for extensionless files in
  ThemingController::getImage()
- Deleting .svg cache files in ImageManager::delete()
- Injecting IAppConfig into ImageManager and reading the cachebuster via
  IAppConfig::getAppValueInt() so the URL returned after upload always
  carries the freshly-incremented value (IConfig::getAppValue() can return
  a stale cached value within the same request)
- Updating the FileInputField Vue component to use a reactive cacheKey ref
  that increments on every upload, so the thumbnail refreshes even when the
  MIME type of the new image is the same as the old one
- Updating unit tests for ImageManager and ThemingController
- Updating psalm baseline for stable32

Backport of #60198

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-05-20 15:50:07 +00:00
..
Controller fix(theming): fix broken custom images introduced by #58224 2026-05-20 15:50:07 +00:00
data fix: generate favourite icon without imagick svg support 2026-04-06 14:52:54 -04:00
Migration feat(lexicon): moving out from unstable 2025-07-24 15:56:33 -01:00
Service chore: run rector 2025-07-01 22:45:52 +02:00
Settings chore: run rector 2025-07-01 22:45:52 +02:00
Themes feat(theming): provide Nextcloud Assistant theming colors 2025-08-27 13:19:05 +02:00
CapabilitiesTest.php chore: run rector 2025-07-01 22:45:52 +02:00
IconBuilderTest.php fix(theming): Fix favicon and touchicon ratios 2026-04-07 12:00:06 +00:00
ImageManagerTest.php fix(theming): fix broken custom images introduced by #58224 2026-05-20 15:50:07 +00:00
ServicesTest.php chore: run rector 2025-07-01 22:45:52 +02:00
ThemingDefaultsTest.php test: add test for theming config casting 2025-11-30 20:40:18 +01:00
UtilTest.php chore: run rector 2025-07-01 22:45:52 +02:00