Project

General

Profile

Actions

Bug #97720

closed

Problem with TYPOScript IMG_RESOURCE and cropping (PHP 8)

Added by Marc Willmann over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-06-01
Due date:
% Done:

100%

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

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.

Actions

Also available in: Atom PDF