Project

General

Profile

Actions

Bug #101185

closed

unaffected crop attribute in ImageViewhelper

Added by Philipp Parzer 12 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Image Cropping
Target version:
-
Start date:
2023-06-28
Due date:
% Done:

100%

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

Description

the class TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper has an attribute 'crop' which is defined as string|bool
but if you inspect the variable $this->arguments['crop'] it is parsed to an array

that affects following line:
$cropVariantCollection = CropVariantCollection::create((string)$cropString);
the argument is parsed to a string and therefore the string 'Array' is given and an empty CropArea is created

could be solved via check:
$cropString = is_array($this->arguments['crop']) ? json_encode($this->arguments['crop']) : $this->arguments['crop'];

tested in TYPO3 11 with PHP 7.4

Actions #1

Updated by Oliver Hader 12 months ago

  • Category set to Image Cropping
Actions #2

Updated by Gerrit Code Review 9 months 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/+/81157

Actions #3

Updated by Gerrit Code Review 9 months ago

Patch set 2 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/+/81157

Actions #4

Updated by Gerrit Code Review 9 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81151

Actions #5

Updated by Gerrit Code Review 9 months 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/+/81192

Actions #6

Updated by Benni Mack 9 months ago

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

Also available in: Atom PDF