Review main Merged

86367[BUGFIX] Fix AbstractFormViewHelper type hint for identity map

Garvin Hicking CR +2 V +2 Easy +2 −2 updated 10/08/24, 07:42

Commit message

With a larger refactoring of #96473 type hinting was introduced
for `AbstractFormViewHelper->renderHiddenIdentityField()`.

The phpdoc annotation previously hinted at the input being of
type 'object' (or null), and the type hint was thus set to
'object', too.

However, the argument restriction of a ViewHelper like
`FormViewHelper` defined an 'object' of type 'mixed',
and would thus allow arrays. Arrays do not need a
hidden identity field, so returning '' for that
would allow the ViewHelper to function properly.

With this patch, the type hint is changed to 'mixed'
now, so that previous ViewHelper usages with arrays
should be restored again and not lead to a type
exception.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
    • Anja Leichsenring +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Garvin Hicking +2
    • Anja Leichsenring +1
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 3

Files 1

Review log 1114

  1. Garvin Hicking uploaded patch set 1 09/27/24, 12:14

  2. Simon Praetorius voted on patch set 1 CR +1 V +1 09/27/24, 12:15

  3. Garvin Hicking commented on patch set 1 09/27/24, 12:16

    @simon@praetorius.me @lolli@schwarzbu.ch thoughts? Another way would be to change 'object' argument to actually be 'object', that would be a breaking change, and also as far as I read the code, an "array" input should be valid.
  4. core-ci voted on patch set 1 V +1 09/27/24, 12:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66747

  5. Simon Praetorius commented on patch set 1 09/27/24, 12:56

    Reply

    I'd say: Fix it first like you did. If we want to limit the argument to "object" (which probably makes sense) we should check if any other fallback code could be removed as well.
  6. Garvin Hicking commented on patch set 1 10/02/24, 16:10

    Related: 103162
  7. Christian Kuhn updated the commit message in patch set 2 CR +1 V +1 10/08/24, 07:07

  8. Christian Kuhn rebased onto patch set 3 10/08/24, 07:07

  9. Christian Kuhn voted on patch set 3 CR +1 V +1 10/08/24, 07:08

  10. Anja Leichsenring voted on patch set 3 CR +1 V +1 10/08/24, 07:10

  11. core-ci voted on patch set 3 V +1 10/08/24, 07:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67323

  12. core-ci voted on patch set 2 V -1 10/08/24, 07:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67322

  13. Garvin Hicking voted on patch set 3 CR +2 V +2 10/08/24, 07:41

  14. Garvin Hicking merged patch set 4 10/08/24, 07:42