#82489No newRecordLink if config.appearance.enabledControls.new = false
Description
Using the following TCA definition only the field label gets rendered in the BE (if no record is assigned). The action button “Create new” is missing.
$addToTcaColumns['my_field'] = [
'label' => 'label',
'config' => [
'type' => 'inline',
'allowed' => 'my_tabel',
'appearance' => [
'enabledControls' => [
'delete' => true,
'dragdrop' => false,
'hide' => true,
'info' => true,
'new' => false,
'sort' => false,
'localize' => true,
],
'collapseAll' => false,
'expandSingle' => false,
'useSortable' => false,
],
'behaviour' => [
'allowLanguageSynchronization' => true,
'localizeChildrenAtParentLocalization' => true,
'enableCascadingDelete' => true,
'disableMovingChildrenWithParent' => false,
],
'foreign_table' => 'my_tabel',
'foreign_field' => 'uid_foreign',
'foreign_sortby' => 'sorting',
'minitems' => 1,
'maxitems' => 1,
],
];
If config.appearance.enabledControls.new = true the “Create new” action button gets rendered, but the new inline record will have a “Create new record after this record” button (plus icon “+”).
That doesn’t make sense if you want exactly one relation (minitems=maxitems=1) – that’s why I disabled this button.
According to TCA reference https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Inline.html#appearance
> enabledControls (array) Associative array … If the accordant values are set to a boolean value (true or false), the control is shown or hidden in the header of each record.
config.appearance.enabledControls.new = false should only affect the inline records and not the “global” new record action button.
Reviews 6
- main 70315[FEATURE] Add TCA option showNewRecordLink
- 10.4 70309[TASK] Restore newRecord level button behaviour
- 11.3 70316[TASK] Restore newRecord level button behaviour
- main 70308[TASK] Restore newRecord level button behaviour
- 10.4 65805[BUGFIX] Use dedicated property to hide newRecordLink button
- main 65701[BUGFIX] Use dedicated property to hide newRecordLink button
Related issues 5
- Bug #71918['appearance']['enabledControls']['new'] = false does not hide "New" button in Inline Elements
- Bug #92397Regression: New property showNewRecordLink is superfluous
- Bug #93595TCA inline element: appearance config partially not working
- Task #94764Revert changes regarding newRecordLink
- Feature #94765Introduce new option "showNewRecordLink"