Bug #101185
closedunaffected crop attribute in ImageViewhelper
100%
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
Updated by Gerrit Code Review about 1 year 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
Updated by Gerrit Code Review about 1 year 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
Updated by Gerrit Code Review about 1 year 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
Updated by Gerrit Code Review about 1 year 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
Updated by Benni Mack about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 385c60a30b8b188f93240f01b1edae2b5371ca59.