#105864Site settings configuration is not working in TSconfig condition
Description
In TYPO3 12 & 13 this condition is not working in TSconfig and throws a log error.
[traverse(page, "uid") == {$myextension.news.startingPoint}]
Expression could not be parsed. – {expression“traverse(page, \“uid\”) == {$myextension.news.startingPoint}”}
This is also not working but doesn’t throw a log error:
[traverse(page, "uid") == "{$myextension.news.startingPoint}"]
For reference, in TYPO3 11 this worked:
[page["uid"] == {$myextension.news.startingPoint}]
Maybe this could also be related to: https://forge.typo3.org/issues/100810
Reviews 3
Related issues 2
Files 2
History 1620
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2024-12-27T13:36:04+00:00" > 12/27/24, 13:36 </span> -
Raphael Zschorsch commented <span data-processor="relativetime" data-value="2024-12-27T15:20:35+00:00" > 12/27/24, 15:20 </span>
I set it like this in the site configuration settings.yaml file:
myextension: news: startingPoint: 14 categoryUid: 2If I leave out the condition part, this works btw:
TCAdefaults { tx_news_domain_model_news { categories = {$myextension.news.categoryUid} } } -
Garvin Hicking commented <span data-processor="relativetime" data-value="2024-12-27T15:48:31+00:00" > 12/27/24, 15:48 </span>
Not exactly my area but have you checked https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/SiteHandling/UseSiteInConditions.html#typoscript-examples and tried something like:
[traverse(page, "uid") == site("configuration")["myextension.news.startingPoint"]]Could also be
[traverse(page, "uid") == site("configuration")["myextension"]["news"][startingPoint"]]I believe expressions are diffferently evaluated and maybe before other constants are resolved like for content assignment in “pure” typoscript.
(Can’t check the code right now as I’m only on mobile but maybe this helps)
-
Raphael Zschorsch commented and changed attached Bildschirmfoto 2024-12-27 um 18.33.35.png <span data-processor="relativetime" data-value="2024-12-27T17:35:16+00:00" > 12/27/24, 17:35 </span>
Unfortunately this doesn’t work. :(
I should also mention, that in the “Page TSconfig” backend module, the values are correctly substituted, so my guess is, that there is a bug in the condition evaluation. -
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-01-06T18:30:26+00:00" > 01/06/25, 18:30 </span>
I now finally tried this with v14 main and v13.
I used the dummy installation here: https://github.com/TYPO3-Documentation/site-introduction.git
- git clone
- ddev start
- make install
- enter password
- ddev launch typo3
- login to backend
- Create fileconfig/sites/main/settings.yaml
- Insert simple contentsomePageUid: 7
- Edit page properties of page UID 7 and set TSconfig to:[traverse(page, "uid") == {$somePageUid}] TCEFORM.tt_content.header_layout { removeItems := addToList(100) } [global] TCEFORM.tt_content.header_layout { removeItems := addToList(4,5) }- Edit a content elemennt on page uid 8 and see “header_layout” can be set to the values “0,2,3,4,5,100“
- Edit a content elemennt on page uid 7 and see “header_layout” can only be set to the values “0,2,3”Could you please describe where I diverge from the setup that creates the issues for you? Do you maybe have an extension at work that operates on the symfony expressions and manipulate it?
-
Raphael Zschorsch commented <span data-processor="relativetime" data-value="2025-01-07T20:39:32+00:00" > 01/07/25, 20:39 </span>
I can’t seem to get it to work. Even without the variable, a simple:
[traverse(page, "uid") == 1]
only works sometimes in Page TSconfig, i.e.:
[traverse(page, "uid") == 14] TCAdefaults { tx_news_domain_model_news { categories = 2 } } [END]I can’t really figure out why it works sometimes or why it fails when I reload all caches of replace 14 with a variable from the site configuration settings.
Can you please check if the above code is working for you? I don’t get any errors in the TYPO3 log file, even with my custom conditions. I also deactivated my custom conditions but still, this is almost only working once and only on page ID 1. Page ID 14 i.e. is not working every time. This is just for TSconfig, in TypoScript the same condition works every time, i.e.
[traverse(page, "uid") == 4] page > [END]
Can you also please check a variable like this extension.xyz.somePageUid instead of only somePageUid?
I set the page TSconfig in the file Configuration/page.tsconfig and not in the page properties. But even in the page properties the condition won’t work.
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-01-07T22:39:14+00:00" > 01/07/25, 22:39 </span>
Yes, I also verified this works with a extensions.xxx.yyy subarray.
It would be helpful if you can get the site-introduction repository to work for us to align our tests?
Your problem could stem from several issues (sitepackages, third party extensions, pagetree TS) and we need to find the minimal setup to trigger your problem. If you can see it working with the site-introduction, then you could try to step-by-step add other parts into it, and see where the problem may be caused.
-
Raphael Zschorsch commented and changed attached Bildschirmfoto 2025-01-11 um 17.51.18.png <span data-processor="relativetime" data-value="2025-01-11T16:52:06+00:00" > 01/11/25, 16:52 </span>
Again, I’m really quite puzzled.
/typo3temp/var/log logfile says this:Sat, 11 Jan 2025 17:48:00 +0100 [ERROR] request="58d8e84cf1bf9" component="TYPO3.CMS.Core.TypoScript.IncludeTree.Visitor.IncludeTreeConditionMatcherVisitor": Expression could not be parsed. - {"expression":"traverse(page, \"uid\") == {$somePageUid}"}And I again want to point out, that the expression is correctly displayed in the backend TSConfig module (see attached screenshot).
What does your logfile say?Maybe this could also be related?
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-01-11T18:21:16+00:00" > 01/11/25, 18:21 </span>
We can only progress here if you could please do what I asked with the site-introduction package and exact steps to reproduce. Thank you!
-
Raphael Zschorsch commented <span data-processor="relativetime" data-value="2025-01-13T11:20:17+00:00" > 01/13/25, 11:20 </span>
I finally figured out what the problem was and this was on my side as I loaded the whole TSconfig for a check in a custom function (BackendUtility::getPagesTSconfig). I fixed this and not the conditions are working, although an error is still thrown in the log file as I mentioned before:
Sat, 11 Jan 2025 17:48:00 +0100 [ERROR] request="58d8e84cf1bf9" component="TYPO3.CMS.Core.TypoScript.IncludeTree.Visitor.IncludeTreeConditionMatcherVisitor": Expression could not be parsed. - {"expression":"traverse(page, \"uid\") == {$somePageUid}"}This is also the case in my test environment with the introduction package as you suggested. Can you confirm this?
-
Garvin Hicking commented and changed status
Needs FeedbackAccepted <span data-processor="relativetime" data-value="2025-01-14T08:44:35+00:00" > 01/14/25, 08:44 </span>Actually I had logging disabled and only checked whether it worked or not. Thanks for insisting to check this!
Indeed I can see the error messages in my log now too. My guess is that the TypoScript parser makes more than one round-trip to parse the TSconfig, once without the site settings applied, and once with.
That requires some more inspection/debugging/tracing.
-
Fabian Schiller commented <span data-processor="relativetime" data-value="2025-02-26T10:26:17+00:00" > 02/26/25, 10:26 </span>
In TYPO3 version 13.4.5, the condition [traverse(page, “uid”) == 182] works as expected, but it also generates error entries in the log. Furthermore, when using multiple such conditions, the log file grows rapidly, leading to significant disk space consumption.
Recently, 60GB of log data was deleted due to this issue.Mon, 25 Nov 2024 11:37:08 +0100 [ERROR] request="22f6c0f859ee9" component="TYPO3.CMS.Core.TypoScript.IncludeTree.Visitor.IncludeTreeConditionMatcherVisitor": Expression could not be parsed. - {"expression":"traverse(page, \"uid\") == 183"} -
Renato Morell commented <span data-processor="relativetime" data-value="2025-03-14T14:41:13+00:00" > 03/14/25, 14:41 </span>
I can absolutely confirm this behaviour in 13.4.7: the log file grows rapidly, without a reason, everything works as expected.
-
Georg Ringer changed Related to #100981 <span data-processor="relativetime" data-value="2025-03-31T15:22:57+00:00" > 03/31/25, 15:22 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95682 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2026-09-07T16:30:08+00:00" > 09/07/26, 16:30 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95682 <span data-processor="relativetime" data-value="2026-11-10T18:02:15+00:00" > 11/10/26, 18:02 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 97566 <span data-processor="relativetime" data-value="2026-11-11T22:18:05+00:00" > 11/11/26, 22:18 </span>
-
Gerrit Code Review pushed patch set 2 for 14.3 to change 97566 <span data-processor="relativetime" data-value="2026-11-11T22:42:51+00:00" > 11/11/26, 22:42 </span>
-
Benni Mack commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-11-11T22:55:14+00:00" > 11/11/26, 22:55 </span>Applied in changeset commit:2afbb89a3944e989487b6eaa3608af53ee9f8612.
-
Georg Ringer changed Related to #111490 <span data-processor="relativetime" data-value="2026-11-18T21:09:31+00:00" > 11/18/26, 21:09 </span>
Where and how exactly do you set $myextension.news.startingPoint ?