Review main Abandoned

81646[BUGFIX] Fix rendering labels for radio and select field types

Marcin Sągol CR 0 V 0 Normal +63 −17 updated 12/09/23, 10:10

Commit message

With the release of TYPO3 12.3, changes were made that deprecated
indexed array keys for TCA items. Please see:

- https://forge.typo3.org/issues/99739
- deprecation: #99739 - Indexed array keys for TCA items

As a result of these changes, the function responsible for generating
labels for the values of the radio field in the column inside the
records list table returned an empty string when a (deprecated)
indexed array of items was used.

The second issue with the (`BackendUtility::getLabelFromItemlist`)
function was that it ignored the `itemsProcFunc` TCA configuration,
and items defined through a custom function were never used.

To address these issues, we now call the itemsProcFunc (if defined)
to handle items defined by such a custom function. To fetch item
labels respecting deprecated indexed item arrays, we use the method
from the core API `SelectItem::fromTcaItemArray()`, which respects
arrays with keys as well as indexed ones. With these changes, we also
pass the label through the `LanguageService` class to handle labels
with `LLL:...` values.

The reported issue mentioned columns with type `radio`, but a
similar problem existed for columns of type `select`, regarding
rendering their labels on the records list table. This problem was
addressed in the same manner.

Inside `TcaRadioItems` class it was also required to call the
`LanguageService::sl()` function to translate labels for items
which were added through the `itemsProcFunc`.

This changes have impact on the following areas, where
labels for select and radio fields might be rendered:

- records list
- record create/edit form
- record info window

Review

  • Code review CR 0

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

  • Verified V 0

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

Issues 1

Files 5