Project

General

Profile

Actions

Bug #96344

closed

Click enlarge (image zoom) throws "Undefined property" PHP warnings

Added by Robert Kärner almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-12-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

2021-12-13 09_13_46-ContentObjectRenderer.php.png (97.7 KB) 2021-12-13 09_13_46-ContentObjectRenderer.php.png crop.data gets stdWrapped into crop configuration Robert Kärner, 2021-12-13 08:20
2021-12-13 09_16_11-LocalCropScaleMaskHelper.php.png (77.6 KB) 2021-12-13 09_16_11-LocalCropScaleMaskHelper.php.png "Wrong" crop configuration gets accessed Robert Kärner, 2021-12-13 08:20
Actions #1

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

Actions #2

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

Actions #3

Updated by Benni Mack almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #4

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF