Project

General

Profile

Actions

Bug #101185

closed

unaffected crop attribute in ImageViewhelper

Added by Philipp Parzer over 1 year ago. Updated 5 months ago.

Status:
Closed
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

Also available in: Atom PDF