简体   繁体   English

TYPO3 8.7 TCA在自己的表上选择

[英]TYPO3 8.7 TCA Select on own Table

We have a problem with a select which is defined in TCA after a core update from TYPO3 6.2 LTS to 8.7 LTS. 在将核心从TYPO3 6.2 LTS更新到8.7 LTS之后,TCA中定义的选择存在问题。

The problem is, that the select uses all available memory. 问题是,选择将使用所有可用内存。 I think, that the problem is caused by the fact, that the select in TCA selects the own table and we have a loop now. 我认为,问题是由以下事实引起的:TCA中的select选择了自己的表,现在我们有了一个循环。

In TYPO3 6.2 the select has worked as expected. 在TYPO3 6.2中,选择已按预期工作。

Can someone confirm this behavior or has a solution for this? 有人可以确认这种行为或对此有解决方案吗?

Best Regards 最好的祝福

Markus Gehrig 马库斯·格里格(Markus Gehrig)

File Configuration/TCA/Override/tt_address.php: 文件配置/TCA/Override/tt_address.php:

'tx_twwcprojectmanager_company' => array(
    'exclude' => 0,
    'label' => 'LLL:EXT:twwc_projectmanager/Resources/Private/Language/locallang_db.xlf:tx_twwcprojectmanager_domain_model_company.tx_twwcprojectmanager_company',
    'config' => array(
        'type' => 'select',
        'items' => array(
            array('LLL:EXT:twwc_projectmanager/Resources/Private/Language/locallang_db.xlf:tt_address.tx_twwczusatzprojekte_nochoice', 0),
        ),
        'foreign_table' => 'tt_address',
        'foreign_table_where' => 'ORDER BY company',
        'minitems' => 0,
        'maxitems' => 1,
    ),
),

You have to exclude the element's uid in your foreign_table_where string: 您必须在foreign_table_where字符串中排除元素的uid:

'foreign_table_where' => ' AND tt_address.uid != ###THIS_UID### ORDER BY tt_address.company'

There are several other markers you could use in a similar context: https://docs.typo3.org/typo3cms/TCAReference/8.7/ColumnsConfig/Type/Select.html#foreign-table-where 您可以在类似的上下文中使用其他几个标记: https : //docs.typo3.org/typo3cms/TCAReference/8.7/ColumnsConfig/Type/Select.html#foreign-table-where

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

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