Review 12.4 Merged

81823[BUGFIX] Handle empty values with FormEngine radio fields

Christian Kuhn CR +2 V +2 Easy +4 −4 updated 11/21/23, 20:27

Commit message

The bug report #102303 indicates that a TCA element type=radio
with items containing an empty string do not get properly
restored/persisted in FormEngine (Backend GUI input fields).

This is because empty attributes from HTML `<input>` fields are
not evaluated, and thus not restored and stored properly when
selected. `GeneralUtility::implodeAttributes()` calls do not
utilize the `keepBlankAttributes` parameter.

The report specifically mentions radio Element types, but also
effects checkboxes and `<option>` tags. An option tag without
a value submits the label of the option instead of an empty
value, so the attribute `value=""` is important.

The `CategoryElement` and `JsonElement` both already use
the parameter `keepBlankAttributes`, so the older FormEngine
Elements were probably not re-investigated.

See #102303 on details how to test this patch.

Docs [1] currently do not mention that "value" may not be
an empty string.

[1] https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Radio/Properties/Items.html

Review

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

Issues 1

Files 4

Review log 510

  1. Christian Kuhn uploaded patch set 1 11/21/23, 15:28

  2. core-ci voted on patch set 1 V +1 11/21/23, 15:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49251

  3. Christian Kuhn uploaded patch set 2 V +1 11/21/23, 18:53

  4. core-ci voted on patch set 2 V -1 11/21/23, 19:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49286

  5. core-ci commented on patch set 2 11/21/23, 19:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49287

  6. Christian Kuhn uploaded patch set 3 V -1 11/21/23, 19:31

  7. core-ci voted on patch set 3 V +1 11/21/23, 19:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49292

  8. core-ci commented on patch set 3 11/21/23, 19:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/49293

  9. Christian Kuhn voted on patch set 3 V +2 CR +2 11/21/23, 20:27

  10. Christian Kuhn merged patch set 4 11/21/23, 20:27