Bug #97720
closedProblem with TYPOScript IMG_RESOURCE and cropping (PHP 8)
100%
Description
The example TS code https://docs.typo3.org/m/typo3/reference-typoscript/11.5/en-us/Functions/Imgresource.html
file {
crop.data = file:current:crop
cropVariant = desktop
}
breaks with TYPO3 11.5 and PHP 8.0 with the following error message.
PHP Warning: Undefined array key "crop" in /var/www/html/vendor/typo3/cms-frontend/Classes/ContentObject/ContentObjectRenderer.php line 4204
As a workaround this can be circumvented by adding an empty crop attribute:
file {
crop =
crop.data = file:current:crop
cropVariant = desktop
}
The problem though is a missing validation in frontend/Classes/ContentObject/ContentObjectRenderer.php in the named line 4204. I will try to provide a fix for that.
Problem is found in TYPO3 11.5.10, but is also in TYPO3 dev-main.
Updated by Gerrit Code Review over 2 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/+/74799
Updated by Gerrit Code Review over 2 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/+/74763
Updated by Marc Willmann over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6fdb5153f0aa7e555815cc2d13181d1f42a13bcc.