Issue Bug Closed

#99796ClickEnlargeViewHelper: wrong data-type for argument `configuration`

Julian Hofmann 02/02/23, 07:38 updated 03/14/23, 11:47

Description

ClickEnlargeViewHelper initializes its argument `configuration` as ‘mixed’, containing “String, \TYPO3\CMS\Core\Resource\File or \TYPO3\CMS\Core\Resource\FileReference with link configuration”.

In fact, this argument is used only once: when passing it to `TypoScriptService::convertPlainArrayToTypoScriptArray()`. This method expects its argument to be an array (`@param array $typoScriptArray The TypoScript array (e.g. array(‘foo’ => ‘TEXT’, ‘foo.’ => array(‘bar’ => ‘baz’)))`) and has ‘array’ as its type declaration.

Seems, there are two issues:
  • The documentation of the argument does not meet its real use
  • The data-type does not meet the usage and will throw an exception

Reviews 2

History 36

  1. Georg Ringer commented and changed status New Accepted 02/02/23, 08:20

    you are absolutley correct, the documentation is wrong. as mixed however allows array as well, nothing will break.

    do you wanna push a change?

  2. Gerrit Code Review pushed patch set 1 for main to change 77678 status Accepted Under Review 02/03/23, 07:03

  3. Gerrit Code Review pushed patch set 1 for 11.5 to change 77850 02/14/23, 12:27

  4. Gerrit Code Review pushed patch set 2 for 11.5 to change 77850 02/15/23, 12:58

  5. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % 02/15/23, 13:00

    Applied in changeset commit:9b67512c93962cf3986b40fef00d03a4d92cb665.

  6. Benni Mack changed status Resolved Closed 03/14/23, 11:47