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
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72770
Updated by Gerrit Code Review almost 3 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72787
Updated by Benni Mack almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 66e9603b04df9134036b474f70cb22fd357e19a5.