Review main Merged

81645[BUGFIX] Handle empty values with FormEngine radio fields

Garvin Hicking CR +2 V +2 Normal +198 −27 updated 11/21/23, 18:43

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.

New acceptance tests are introduced to cover checking for the
ability to set and retrieve radio selection states.
EXT:styleguide is enhanced to also put empty elements into
the mix. Another acceptance test is stabilized along the way.

[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 8