Review main Merged

96781[BUGFIX] Support enums in Fluid form field ViewHelpers

Jan Kornblum CR +2 V +2 Hard +340 −0 updated 10/20/26, 12:41

Commit message

Form field ViewHelpers bound to a property holding an enum could not
handle the value: radio buttons and checkbox groups never showed the
matching option as checked, and f:form.hidden, f:form.textarea,
f:form.password, f:form.submit and f:form.button failed with
"Object of class ... could not be converted to string".

AbstractFormFieldViewHelper::convertToPlainValue() now converts
backed enums to their value and pure enums to their name, the same
representation the Extbase EnumConverter maps back on submit.

f:form.select keeps the enum untouched when "optionValueField" is
set, so the selected value is resolved through the same field as the
options, e.g. optionValueField="name" on a backed enum.

More tests pinpoint this behaviour now across abstract-based
ViewHelpers.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 11

Review log 1113

  1. Jan Kornblum uploaded patch set 1 10/17/26, 11:15

  2. core-ci voted on patch set 1 V +1 10/17/26, 11:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111447

  3. Simon Schaufelberger voted on patch set 1 CR +1 V +1 10/17/26, 11:50

  4. Garvin Hicking voted on patch set 1 CR +1 10/17/26, 12:56

  5. Garvin Hicking commented on patch set 1 10/17/26, 12:57

    AbstractFormFieldViewHelper.php:204

    Wondering if we could solce this at the persistencemanager-level here instead, or what problems that would cause
  6. Jan Kornblum commented on patch set 1 10/17/26, 15:30

    AbstractFormFieldViewHelper.php:204 Reply

    I think enum normalization fits better into AbstractFormFieldViewHelper::convertToPlainValue(), since enum values/names are not persistence identifiers. Handling this in the PersistenceManager would also affect other consumers of that API. This is also consistent with the existing enum handling in SelectViewHelper::getOptionValueScalar().
  7. Garvin Hicking commented on patch set 1 10/17/26, 15:45

    AbstractFormFieldViewHelper.php:204 Reply

    Understood, I can follow the argumentation.
  8. Garvin Hicking commented on patch set 1 CR -1 10/20/26, 10:20

    on it...
  9. Garvin Hicking uploaded patch set 2 CR +1 V +1 10/20/26, 11:08

  10. core-ci voted on patch set 2 V +1 10/20/26, 11:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111798

  11. Garvin Hicking commented on patch set 2 CR +1 V +1 10/20/26, 11:43

    Reply

    Done
  12. Oli Bartsch voted on patch set 2 CR +2 V +2 10/20/26, 12:32

  13. Oli Bartsch merged patch set 3 10/20/26, 12:41