TYPO3 8.7:编辑记录时不保留MM_match_fields

时间:2018-10-01 06:59:23

标签: typo3 typo3-8.x

我想在页面和其他表格(例如新闻和fe_users)之间创建关系。 为此,我在有关表中创建了3个字段(新闻或fe_users)。 每个字段都是使用此配置附加到给定类别的页面的MM选择

'policies' => [
    'displayCond' => 'FIELD:sys_language_uid:=:0',
    'exclude' => true,
    'label' => $ll . 'tx_relations.policies',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectMultipleSideBySide',
        'enableMultiSelectFilterTextfield' => true,
        'foreign_table' => 'pages',
        'foreign_table_where' => 'AND pages.uid IN (SELECT uid_foreign FROM sys_category_record_mm WHERE sys_category_record_mm.uid_local = 1 AND sys_category_record_mm.tablenames = "pages") ORDER BY pages.title ASC, pages.uid ASC',
        'MM' => 'tx_pages_references_mm',
        'MM_match_fields' => [
            'tablenames' => $tablename,
            'fieldname' => 'policies',
        ],
        'minitems' => 0,
        'maxitems' => 9999
    ]
],
'working_groups' => [
    'displayCond' => 'FIELD:sys_language_uid:=:0',
    'exclude' => true,
    'label' => $ll . 'tx_relations.working_groups',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectMultipleSideBySide',
        'enableMultiSelectFilterTextfield' => true,
        'foreign_table' => 'pages',
        'foreign_table_where' => 'AND pages.uid IN (SELECT uid_foreign FROM sys_category_record_mm WHERE sys_category_record_mm.uid_local = 2 AND sys_category_record_mm.tablenames = "pages") ORDER BY pages.title ASC, pages.uid ASC',
        'MM' => 'tx_pages_references_mm',
        'MM_match_fields' => [
            'tablenames' => $tablename,
            'fieldname' => 'working_groups',
        ],
        'minitems' => 0,
        'maxitems' => 9999
    ]
],
'networks' => [
    'displayCond' => 'FIELD:sys_language_uid:=:0',
    'exclude' => true,
    'label' => $ll . 'tx_relations.networks',
    'config' => [
        'type' => 'select',
        'renderType' => 'selectMultipleSideBySide',
        'enableMultiSelectFilterTextfield' => true,
        'foreign_table' => 'pages',
        'foreign_table_where' => 'AND pages.uid IN (SELECT uid_foreign FROM sys_category_record_mm WHERE sys_category_record_mm.uid_local = 3 AND sys_category_record_mm.tablenames = "pages") ORDER BY pages.title ASC, pages.uid ASC',
        'MM' => 'tx_pages_references_mm',
        'MM_match_fields' => [
            'tablenames' => $tablename,
            'fieldname' => 'networks',
        ],
        'minitems' => 0,
        'maxitems' => 9999
    ]
],

保存记录时,

我在数据库中有以下记录

 uid_local uid_foreign    tablenames                   fieldname      sorting
 1         129            tx_news_domain_model_news    policies       1
 1         130            tx_news_domain_model_news    working_groups 1
 1         131            tx_news_domain_model_news    networks       1

对我来说哪个似乎正确...

但是当我在BE中编辑记录时,未选中每个页面...

因此,INSERT似乎没问题,但是SELECT却失败了……您能告诉我我在做什么错吗?

0 个答案:

没有答案
相关问题