Review main Merged

75004[BUGFIX] Assure object is used to render hidden identity fields

Elias Häußler CR +2 V +2 Easy +3 −0 updated 07/01/22, 08:59

Commit message

With #96473, the first parameter of
`AbstractFormViewHelper::renderHiddenIdentityField()` was hardened
to `object|null`. This is actually fine since only objects are suitable
to render those fields (falling back to NULL, probably for bc reasons).
However, form elements in EXT:form cannot be directly accessed with the
FormRuntime. Instead, calling `$formRuntime[$formField]` returns the
current value of the form element instead of the elemnt itself.

To avoid situations where everything else than an object is passed to
said method, the resolved object is now checked and falls back to NULL
if it's not an object. This change restores the previous behavior of
EXT:form elements prior to the change introcuded with #96473.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • waldhacker +1
    • Björn Jacob +1
  • Verified V +2 Done
    • Oliver Hader +2
    • waldhacker +1
    • Björn Jacob +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 68

  1. Elias Häußler uploaded patch set 1 07/01/22, 08:36

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

  3. core-ci voted on patch set 1 V +1 07/01/22, 08:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28551

  4. Oliver Hader commented on patch set 1 V +1 CR +1 07/01/22, 08:52

    Previously `renderHiddenIdentityField` returned an empty string in case not object was given - which is not added as explicit check. Looks good to me 👍
  5. Björn Jacob commented on patch set 1 V +1 CR +1 07/01/22, 08:58

    Awesome!
  6. waldhacker voted on patch set 1 V +1 CR +1 07/01/22, 08:58

  7. Oliver Hader voted on patch set 1 V +2 CR +2 07/01/22, 08:59

  8. Oliver Hader merged patch set 2 07/01/22, 08:59