简体   繁体   English

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

[英]Cascade delete TYPO3 inline records don't work

I have a TYPO3 extension for some products wich uses inline records to add documentgroups to a product. 我对某些产品使用TYPO3扩展名,但它们使用内联记录将文档组添加到产品中。 Deleting the product should also delete the documentgroups (inline records). 删除产品还应该删除文档组(内联记录)。

The documentation says behaviour.enableCascadingDelete is set to true by default, but the documentgroups are not deleted. 该文档说behaviour.enableCascadingDelete默认情况下设置为true ,但不会删除文档组。 Setting this value in the TCA does not make a difference. 在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,
    ]
],

enableCascadingDelete has no effect on MM related tables. enableCascadingDelete对MM相关表没有影响。 In \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler->deleteRecord_procBasedOnFieldType the inline type is checked and only if it's of type field ( foreign_field must be set in the TCA) or list ( MM and foreign_field must not be set in TCA) child entries will be deleted. \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler->deleteRecord_procBasedOnFieldType将检查内联类型,并且仅当其类型为field (必须在TCA中设置foreign_field )或list (不得在TCA中设置MMforeign_field )的子项时将被删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM