Issue Bug Closed

#82489No newRecordLink if config.appearance.enabledControls.new = false

Georg Tiefenbrunn 09/15/17, 12:12 updated 09/29/20, 15:07

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