Project

General

Profile

Actions

Bug #98656

closed

Overriding ['TCA']['pages']['columns']['categories']['config']['foreign_table_where'] does not work

Added by Ralph Brugger about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Miscellaneous
Target version:
-
Start date:
2022-10-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

In one of our extension we're overriding the TCA of the pages colums categories:

extfoobar\Configuration\TCA\Overrides\pages.php


$GLOBALS['TCA']['pages']['columns']['categories']['config']['foreign_table_where'] = " AND sys_category.pid IN (###PAGE_TSCONFIG_IDLIST###) AND sys_category.sys_language_uid IN (-1, 0) ORDER BY sys_category.sorting ASC";

But this will allways be override by the core:

typo3_src-11.5.17/typo3/sysext/core/Classes/Preparations/TcaPreparation.php

protected function configureCategoryRelations(array $tca): array
{

    ....

  // Initialize default column configuration and merge it with already defined
  $fieldConfig['config']['size'] ??= 20;

  // Force foreign_table_* fields for type category
  $fieldConfig['config']['foreign_table'] = 'sys_category';
  $fieldConfig['config']['foreign_table_where'] = ' AND {#sys_category}.{#sys_language_uid} IN (-1, 0)';

For ['size'] it will be checked if there's already a value defined, but not for ['foreign_table_where'].

Shluld it be like this?

  $fieldConfig['config']['foreign_table_where'] =  $fieldConfig['config']['foreign_table_where'] ?? ' AND {#sys_category}.{#sys_language_uid} IN (-1, 0)';

Or am I doing something wrong?

Ralph


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #94622: Introduce new TCA type "category"Closed2021-07-23

Actions
Actions

Also available in: Atom PDF