Bug #96344
closedClick enlarge (image zoom) throws "Undefined property" PHP warnings
100%
Description
When "image_zoom" is enabled on a Text and Media element, four PHP warnings are logged:
PHP Warning: Undefined property: stdClass::$height in /typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 85
PHP Warning: Undefined property: stdClass::$width in /typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 85
PHP Warning: Undefined property: stdClass::$y in /typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 85
PHP Warning: Undefined property: stdClass::$x in /typo3/sysext/core/Classes/Resource/Processing/LocalCropScaleMaskHelper.php line 85
It seems that the image zoom feature stores the cropArea configuration in $cropData->default->cropArea instead of directly in $cropData.
See the attached screenshots for further information.
One could add fallbacks to the property access (i.e. $cropData->x ?? null), but that would just get rid of the PHP warnings instead of solving the actual problem.
Files