Bug #94488
closedpid not configurable in addRecord TCA
0%
Description
TCA/select/selectMultipleSideBySide/addRecord::render() delivers always pid = default=currentPid, so '###SITEROOT###' or 'pid'=>'xx' does not work.
TCA Documentation: https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/selectMultipleSideBySide.html#fieldcontrol
See typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php:39
Is:
$options = $this->data['renderData']['fieldControlOptions'];
Should be
$options = $this->data['renderData']['fieldControl']['addRecord'];
Array 'fieldControlOptions' seems never be populated and correct config info is in '['fieldControl'][addRecord]'. Maybe bug is elsewhere (who does fill ['fieldControlOptions']?) but patching this worked for me.
Use Case: this has to work as documented:
...
'someField' => [
'exclude' => true,
'label' => $ll.'.someField',
'config' => [
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'size' => 3,
'minitems' => 1,
'fieldControl' => [
'addRecord' => [
'disabled' => false,
'title' => 'addRecordTest for Test',
'setValue' => 'set',
'pid' => '###SITEROOT###', // this does not work as documented!!!
],
'editPopup' => [
'disabled' => false,
],
],
'foreign_table' => 'someTable',
'foreign_table_where' =>
'AND {#someTable}.{#pid} IN(###SITEROOT###) '
],
],
...
If we touch addRecord class anyway, we could enable the marker ###PAGE_TSCONFIG_ID### by something like this:
if (isset($parameterArray['fieldTSConfig']['PAGE_TSCONFIG_ID']))
{
$pid = $parameterArray['fieldTSConfig']['PAGE_TSCONFIG_ID'];
}
Same for Typo3 v9