【问题标题】:TYPO3 TCA Type IRRE very slow with tt_contentsTYPO3 TCA 类型 IRRE 非常慢,带有 tt_contents
【发布时间】:2017-10-25 07:58:04
【问题描述】:

有人知道以下查询的来源吗?当我在 TCA 中使用内联类型来关联 tt_content 记录时,由于一个文件夹中有大量 tt_content 记录,我会遇到这种关系的巨大性能问题。 (ID:45)

SELECT tt_content.uid
     , tt_content.header
     , tt_content.subheader
     , tt_content.bodytext
     , tt_content.t3ver_id
     , tt_content.t3ver_state
     , tt_content.t3ver_wsid
     , tt_content.t3ver_count
     , tt_content.CType
     , tt_content.hidden
     , tt_content.starttime
     , tt_content.endtime
     , tt_content.fe_group
FROM tt_content, pages
WHERE pages.uid=tt_content.pid
    AND pages.deleted = 0
    AND tt_content.deleted = 0
    AND 1=1
    AND tt_content.pid = 45
    AND tt_content.sys_language_uid IN (-1,0)

我使用这个配置:

'content_elements' => [
            'displayCond' => [
                'OR' => [
                    'FIELD:tasktype:=:1',
                    'FIELD:tasktype:=:5'
                ]
            ],
            'exclude' => true,
            'l10n_mode' => 'mergeIfNotBlank',
            'label' => 'content',
            'config' => [
                'type' => 'inline',
                'allowed' => 'tt_content',
                'foreign_table' => 'tt_content',
                'foreign_sortby' => 'sorting',
                'foreign_field' => 'tx_contentmanager_related_content',
                'minitems' => 0,
                'maxitems' => 99,
                'appearance' => [
                    'collapseAll' => true,
                    'expandSingle' => true,
                    'levelLinksPosition' => 'bottom',
                    'useSortable' => true,
                    'showPossibleLocalizationRecords' => true,
                    'showRemovedLocalizationRecords' => true,
                    'showAllLocalizationLink' => true,
                    'showSynchronizationLink' => true,
                    'enabledControls' => [
                        'info' => false,
                    ]
                ]
            ]
        ],

【问题讨论】:

  • 这是一个核心问题。我试着在周末调试它
  • 感谢您的快速回复。我也尝试定位问题。我很高兴能得到这样一位经验丰富的开发人员的支持。

标签: performance typo3 backend tx-news


【解决方案1】:

我调试了核心文件:/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php

问题似乎在于 tt_content 记录的翻译处理。

$GLOBALS['TCA']['tt_content']['columns']['l18n_parent']['config']['foreign_table_where'] = AND tt_content.pid=###CURRENT_PID### AND tt_content.sys_language_uid IN (-1,0)

但我不知道为什么必须获取当前 pid 中的所有内容。 作为临时解决方案,我更改了 TCA 条目,因为我们不在页面上使用 tt_content 并且还没有翻译。 我不确定这是否是一个好主意,但目前它解决了我们对编辑器的性能问题。

$GLOBALS['TCA']['tt_content']['columns']['l18n_parent']['config']['foreign_table_where'] = 'AND tt_content.pid = -1 AND tt_content.sys_language_uid IN (-1,0)';

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-17
  • 1970-01-01
相关资源
最近更新 更多