Issue Bug Closed

#101185unaffected crop attribute in ImageViewhelper

Philipp Parzer 06/28/23, 07:15 updated 07/09/24, 14:15

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

Reviews 3

History 37

  1. Oliver Hader changed category 06/28/23, 07:51

  2. Gerrit Code Review pushed patch set 1 for main to change 81157 status New Under Review 09/21/23, 13:59

  3. Gerrit Code Review pushed patch set 2 for main to change 81157 09/21/23, 16:15

  4. Gerrit Code Review pushed patch set 1 for 12.4 to change 81151 09/22/23, 15:23

  5. Gerrit Code Review pushed patch set 1 for 11.5 to change 81192 09/22/23, 15:23

  6. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % 09/22/23, 15:50

    Applied in changeset commit:385c60a30b8b188f93240f01b1edae2b5371ca59.

  7. Benni Mack changed status Resolved Closed 07/09/24, 14:15