Project

General

Profile

Actions

Bug #100981

open

traverse(site('configuration') doesn't work in content edit view

Added by Jessica Jagodzinski 11 months ago. Updated 11 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-06-09
Due date:
% Done:

0%

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

Description

It seems that the site configuration is not available in the content editing view for traverse conditions.

To reproduce the issue, please follow these steps:

In the Site Configuration, add the following configuration:

settings:
  showHeader: 1

In the TSconfig, add the following condition:

[{$showHeader} != 1]
  TCEFORM.tt_content.CType.removeItems := addToList(header)
[global]

Result: The Header element is displayed in the new Content Wizard. Even when creating a new element, Header remains available in the CType selection.

However, this approach leads to excessive log entries. The recommendation is to use traverse.

Now, instead of the above condition in TsConfig, use the following condition:

[traverse(site('configuration'), 'settings/showHeader') != 1]
  TCEFORM.tt_content.CType.removeItems := addToList(header)
[global]


The Header element will still be displayed in the new Content Wizard, but it will no longer appear in the CType selection when creating or editing an element.

In this test, the value in the Site Configuration does not affect the behavior, as it seems that Site Configuration is not available in the Content Editing for traverse.

(If you change the value in the Site Configuration to 0, the Header element will not be displayed in either case.)

I have tested the same scenario with TYPO3 12, where this behavior does not occur.

Actions #1

Updated by Jessica Jagodzinski 11 months ago

  • Description updated (diff)
Actions

Also available in: Atom PDF