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 #1

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

Actions #2

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

Actions #3

Updated by Marc Willmann over 2 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