级联删除TYPO3内联记录不起作用

时间:2019-07-05 06:45:21

标签: typo3 typo3-9.x

我对某些产品使用TYPO3扩展名,它们使用内联记录将文档组添加到产品中。删除产品还应该删除文档组(内联记录)。

文档说behaviour.enableCascadingDelete默认情况下设置为true,但是未删除文档组。在TCA中设置此值没有什么区别。

'documentgroups' => [
    'exclude' => 1,
    'label' => $ll . ".documentgroups",
    'config' => [
        'type' => 'inline',
        'allowed' => 'tx_product_domain_model_docgroup',
        'behaviour' => [
            'allowLanguageSynchronization' => true,
            'enableCascadingDelete' => true,
        ],
        'foreign_table' => 'tx_product_domain_model_docgroup',
        'MM'            => 'tx_product_mm',
        'MM_match_fields' => [
            'tablenames' => 'tx_product_domain_model_docgroup',
            'fieldname' => 'documentgroups',
            'table_local' => $tableName,
        ],
        'foreign_sortby' => 'sorting',
        'minitems' => 0,
        'maxitems' => 99,
    ]
],

1 个答案:

答案 0 :(得分:1)

enableCascadingDelete对与MM相关的表没有影响。在\TYPO3\CMS\Core\DataHandling\DataHandler->deleteRecord_procBasedOnFieldType中,仅当内联类型为field(必须在TCA中设置foreign_fieldlistMM和{{ 1}}不能在TCA中设置)子条目将被删除。

相关问题