#111027TCA type=input valuePicker documentation and implementation don't match
Description
As described in TCA docs for type=input, there’s a mismatch in the two different code examples
https://docs.typo3.org/permalink/t3tca:tca-example-input-33 :
[
'columns' => [
'input_33' => [
'label' => 'input_33',
'description' => 'valuePicker',
'config' => [
'type' => 'input',
'size' => 20,
'eval' => 'trim',
'valuePicker' => [
'items' => [
[
'spring',
'Spring',
],
[
'summer',
'Summer',
],
[
'autumn',
'Autumn',
],
[
'winter',
'Winter',
],
],
],
],
],
],
]
https://docs.typo3.org/permalink/t3tca:confval-input-valuepicker :
'my_favorite_season' => [
'label' => 'Season',
'config' => [
'type' => 'input',
'valuePicker' => [
'items' => [
['label' => 'Spring', 'value' => 'spring'],
['label' => 'Summer', 'value' => 'summer'],
['label' => 'Autumn', 'value' => 'autumn'],
['label' => 'Winter', 'value' => 'winter'],
],
],
],
],
As you can see the first documentation is missing the label and value array keys.
This itself would not be worth an issue in forge, but rather the implementation in TYPO3 CMS v13 is lacking support for the label and value array keys, as seen here:
foreach ($config['valuePicker']['items'] as $item) {
$valuePickerHtml[] = '<option value="' . htmlspecialchars($item[1]) . '">' . htmlspecialchars($languageService->sL($item[0])) . '</option>';
}
Since TYPO3 CMS v14 there’s now proper support for this:
https://github.com/TYPO3/typo3/blob/v14.3.8/typo3/sysext/backend/Classes/Form/Element/InputTextElement.php#L181-L183
foreach ($config['valuePicker']['items'] as $item) {
$mainFieldHtml[] = '<typo3-backend-combobox-choice value="' . htmlspecialchars($item['value']) . '">' . htmlspecialchars($languageService->sL($item['label'])) . '</typo3-backend-combobox-choice>';
}
Now I was wondering, if adding proper support for label and value array keys for valuePicker is a bugfix or adding a new feature (which won’t get added to older TYPO3 CMS versions).
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 2
-
Garvin Hicking commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-10-12T09:44:50+00:00" > 10/12/26, 09:44 </span>I’ve discussed this internally, we’d rather not touch v13 in this regard due to it being in “important fixes only” mode, and this structure can be evaluated version-specifically on runtime in TCA of extensions. With the fix being in v14 we believe this is the less-breaking and maintenance-hassle-freer version to go with, hope you can understand. Thanks for bringing it up!
EDIT, copying the permalink won’t use the proper TYPO3 CMS version of the documentation…
Thus here are the correct links to TYPO3 CMS v13
> As described in TCA docs for
type=input, there’s a mismatch in the two different code examples>
> https://docs.typo3.org/m/typo3/reference-tca/13.4/en-us/ColumnsConfig/Type/Input/Index.html#tca-example-input-33 :
> […]
>
>
> https://docs.typo3.org/m/typo3/reference-tca/13.4/en-us/ColumnsConfig/Type/Input/Index.html#confval-input-valuepicker :
> […]
>
> As you can see the first documentation is missing the
labelandvaluearray keys.>
> This itself would not be worth an issue in forge, but rather the implementation in TYPO3 CMS v13 is lacking support for the
labelandvaluearray keys, as seen here:>
> https://github.com/TYPO3/typo3/blob/v13.4.36/typo3/sysext/backend/Classes/Form/Element/InputTextElement.php#L196-L198
> […]
>
> Since TYPO3 CMS v14 there’s now proper support for this:
> https://github.com/TYPO3/typo3/blob/v14.3.8/typo3/sysext/backend/Classes/Form/Element/InputTextElement.php#L181-L183
>
> […]
>
>
> Now I was wondering, if adding proper support for
labelandvaluearray keys forvaluePickeris a bugfix or adding a new feature (which won’t get added to older TYPO3 CMS versions).