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 #1

Updated by Lina Wolf over 2 years ago

  • Category set to FormEngine aka TCEforms

We need to document, if this change in behavior was intended https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TSconfig/issues/157, fix it if not intended.

Actions #2

Updated by Benni Mack over 1 year ago

  • Status changed from New to Accepted

Hey Philipp,

good point, I think the new solution (starting at "1") is a better starting number than "0". I think we should document this. Will put this to the docs team.

Actions #3

Updated by Philipp Kitzberger over 1 year ago

Ehm, in TypoScript it's starting with 0 though. I think we shouldn't have a difference here.

Actions

Also available in: Atom PDF