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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 4