[BUGFIX] Update selected ratio in preview element
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Imaging / ImageManipulation / CropVariantCollection.php
index 7327a68..949dde5 100644 (file)
@@ -58,13 +58,13 @@ class CropVariantCollection
                         $id = key($persistedCollectionConfig);
                         next($persistedCollectionConfig);
                     }
-                    if (isset($persistedCollectionConfig[$id]['cropArea'], $cropVariantConfig['cropArea'])) {
+                    if (isset($persistedCollectionConfig[$id]['cropArea'])) {
                         $cropVariantConfig['cropArea'] = $persistedCollectionConfig[$id]['cropArea'];
                     }
                     if (isset($persistedCollectionConfig[$id]['focusArea'], $cropVariantConfig['focusArea'])) {
                         $cropVariantConfig['focusArea'] = $persistedCollectionConfig[$id]['focusArea'];
                     }
-                    if (isset($persistedCollectionConfig[$id]['selectedRatio'], $cropVariantConfig['selectedRatio'])) {
+                    if (isset($persistedCollectionConfig[$id]['selectedRatio'], $cropVariantConfig['allowedAspectRatios'][$persistedCollectionConfig[$id]['selectedRatio']])) {
                         $cropVariantConfig['selectedRatio'] = $persistedCollectionConfig[$id]['selectedRatio'];
                     }
                 }