Project

General

Profile

Actions

Bug #96385

open

Treelevel wrong in PageTS conditions

Added by Philipp Kitzberger over 2 years ago. Updated over 1 year ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2021-12-18
Due date:
% Done:

0%

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

Description

For an TYPO3 upgrade I've had to migrate oldschool PageTS conditions to symfony expression syntax.

That's when I've noticed that [tree.level = X] is behaving differently than [treeLevel = X] used to do. We've usually used this to show certain fields only on site root level, e.g. is_siteroot, backend_layout and backend_layout_next_level.

First off we hide certain fields globally:

TCEFORM.pages.is_siteroot.disabled = 1
TCEFORM.pages.backend_layout.disabled = 1
TCEFORM.pages.backend_layout_next_level.disabled = 1

But show them on root pages (old syntax):
[treeLevel = 0]
TCEFORM.pages.is_siteroot.disabled = 0
TCEFORM.pages.backend_layout.disabled = 0
TCEFORM.pages.backend_layout_next_level.disabled = 0
[global]

Which translates to the new syntax:
[tree.level == 1]
TCEFORM.pages.is_siteroot.disabled = 0
TCEFORM.pages.backend_layout.disabled = 0
TCEFORM.pages.backend_layout_next_level.disabled = 0
[global]

As you can see, there's a difference in what's considered to be treelevel 0. In my opinion that's a bug.

Another thing is that for nested sites the treelevel is not reset even though there's a sys_template record with root=1 set that is processed correctly in FE TypoScript.

So to make the snippet work for PageTS we gotta use this for a root site that's located on absolute treelevel 3:

[tree.level == 4]
TCEFORM.pages.is_siteroot.disabled = 0
TCEFORM.pages.backend_layout.disabled = 0
TCEFORM.pages.backend_layout_next_level.disabled = 0
[global]

Actions

Also available in: Atom PDF