Actions
Bug #102616
closedTCA type selectSingle with itemsProcFunc doesn't show information in list view nor in export CSV
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2023-12-06
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
If you define a TCA field like this :
'my_col' => [
'exclude' => false,
'label' => 'My col label',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'default' => 'value-1',
'itemsProcFunc' => \Vendor\MyExtUserFunc\TcaUserFunc::class ::class . '->getMyCol'
]
]
with itemsProcFunc like this :
public function getMyCol(&$parameters): void
{
$parameters['items'][] = ['Label value 1', 'value-1'];
$parameters['items'][] = ['Label value 2', 'value-2'];
}
In BE list view, if you want to display the 'my_col' value - or export it into CSV - by setting 'show columns' 'my_col' to true, the field show the value instead of the translation. I.e. 'value-1' or 'value-2' instead of 'Label value 1' or 'Label value 2'.
While it works well with TCA like this :
'getMyCol' => [
'exclude' => false,
'label' => 'My col label',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'default' => 'value-1',
'items' => [
['Label value 1', 'value-1'],
['Label value 2', 'value-2'],
]
]
]
Same problem as this one https://forge.typo3.org/issues/100855
Actions