http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692018-11-03T19:11:23ZTYPO3 ForgeTYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3901282018-11-03T19:11:23ZGeorg Ringer
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/86807">Bug #86807</a>: Some symfony expression condition won't work reliable (in TypoScript)</i> added</li></ul> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3901552018-11-04T18:54:31ZGeorg Ringer
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/86763">Bug #86763</a>: Backend Layout Slide not working in FLUIDTEMPLATE Variables after Upgrade to 9.5.0</i> added</li></ul> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3901572018-11-04T18:54:36ZGeorg Ringer
<ul><li><strong>Related to</strong> deleted (<i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/86763">Bug #86763</a>: Backend Layout Slide not working in FLUIDTEMPLATE Variables after Upgrade to 9.5.0</i>)</li></ul> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3903722018-11-07T22:15:13ZFrank Näglerfrank.naegler@typo3.org
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p>I have tried to reproduce this issue, but with and without cache it works for me very well.<br />Can you please check the current master version and maybe provide more information about your setup?</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3904052018-11-08T11:03:13ZPhilipp Seiler
<ul></ul><p>No, still doesn't work.</p>
<p>I found out, that as soon as I activate an applicationContext-condition, the bug appears:</p>
<pre>
[applicationContext == 'Development']
anything
[END]
</pre>
<p>Also EXT:news extension includes a condition, that triggers the bug as well:<br /><pre>
[globalVar = LIT:0<{$styles.content.textmedia.maxW}]
plugin.tx_news.settings.detail.media.image.lightbox {
enabled = {$styles.content.textmedia.linkWrap.lightboxEnabled}
class = {$styles.content.textmedia.linkWrap.lightboxCssClass}
width = {$styles.content.textmedia.linkWrap.width}
height = {$styles.content.textmedia.linkWrap.height}
}
[global]
</pre></p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3905472018-11-09T17:12:25ZFrank Näglerfrank.naegler@typo3.org
<ul></ul><p>that is very wiered... also with the additional conditions I can't reproduce the problem. :( <br />can you provide more info? maybe the complete TypoScript?</p>
<p>Is the feature toggle "TypoScript.strictSyntax" enabled or disabled?</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3907122018-11-13T13:26:25ZPhilipp Seiler
<ul></ul><p>Latest typo3-9 master branch. Local, pretty much bare development system, nothing is included at the root template.</p>
<p>Manually set root template setup:<br /><pre>
page = PAGE
page {
type = 0
}
page.10 >
page.10 = TEXT
page.10.value = This is any page
[3 in tree.rootLineIds]
page.10 >
page.10 = TEXT
page.10.value = This is page 3
[END]
</pre></p>
<p>1. Call <em>index.php?id=1</em>, output is: <em>This is any page</em><br />2. Reload <em>index.php?id=1</em>, output is: <em>This is any page</em><br />3. Call <em>index.php?id=3</em>, output is: <em>This is page 3</em><br />4. Reload <em>index.php?id=3</em>, output is: <em>This is page 3</em><br />5. Call <em>index.php?id=1</em>, output is: <em>This is any page</em><br />6. Reload <em>index.php?id=1</em>, output is: <em>This is any page</em><br />7. Call <em>index.php?id=3</em>, output is: <em>This is page 3</em><br />8. Reload <em>index.php?id=3</em>, output is: <em>This is page 3</em></p>
<p>OK.</p>
<p>Change root template setup to:<br /><pre>
page = PAGE
page {
type = 0
}
page.10 >
page.10 = TEXT
page.10.value = This is any page
[3 in tree.rootLineIds]
page.10 >
page.10 = TEXT
page.10.value = This is page 3
[END]
[applicationContext == 'Development']
page.20 >
page.20 = TEXT
page.20.value = Development context is active
[END]
</pre></p>
<p>1. Call <em>index.php?id=1</em>, output is: <em>This is any pageDevelopment context is active</em><br />2. Reload <em>index.php?id=1</em>, output is: <em>This is any pageDevelopment context is active</em><br />3. Call <em>index.php?id=3</em>, output is: <em>This is page 3Development context is active</em><br />4. Reload <em>index.php?id=3</em>, output is: <em>This is any pageDevelopment context is active</em> => Incorrect<br />5. Call <em>index.php?id=1</em>, output is: <em>This is any pageDevelopment context is active</em><br />6. Reload <em>index.php?id=1</em>, output is: <em>This is any pageDevelopment context is active</em><br />7. Call <em>index.php?id=3</em>, output is: <em>This is any pageDevelopment context is active</em> => Incorrect<br />8. Reload <em>index.php?id=3</em>, output is: <em>This is any pageDevelopment context is active</em> => Incorrect</p>
<p>Not OK.</p>
<p>Procedure described does not change, whether TypoScript.strictSyntax is enabled or not.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3908682018-11-16T10:58:59ZPhilipp Seiler
<ul></ul><p>I've implemented a quick bugfix for this:</p>
<p><em>TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher</em>:<br /><pre>
/**
* Determines the rootline for the current page.
*
* @return array The rootline for the current page.
* @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
*/
protected function determineRootline()
{
return (array)$this->getTypoScriptFrontendController()->tmpl->rootLine;
}
</pre></p>
<p>This method gets the current rootline from the template. That rootline is determined within TemplateService in a method called start(...). However, this method is not called, if the template has been cached. Therefore rootline is not created, and the condition fails.</p>
<p>Simple fix: Don't use rootline from TemplateService, but from FrontendController itself. This should always return the current rootline, no matter if the Template has been cached already. This seems to work for now, but sideffects may be possible.</p>
<pre>
protected function determineRootline()
{
return (array)$this->getTypoScriptFrontendController()->rootLine;
}
</pre> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3909052018-11-18T11:49:36ZSebastian Kleinlaitnin@gmx.net
<ul></ul><p>I was able to reproduce the behaviour as described by Philipp.</p>
<p>Philipp's suggested change does fix this issue as well as mine in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Some symfony expression condition won't work reliable (in TypoScript) (Closed)" href="http://forge.typo3.org/issues/86807">#86807</a>.</p>
<p>I'm as well incapable to predict further impacts of this change. Maybe it can be a hint to narrow down the original issue.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3909952018-11-21T12:58:11Ztaywa gmbhra@taywa.ch
<ul></ul><p>It looks like this problem is not exclusive for tree.rootLineIds, but applies also to tree.level.</p>
<pre>
page.10.variables.foo = TEXT
page.10.variables.foo.value = bar
[tree.level == 3]
page.10.variables.foo.value = foo
[end]
</pre>
<p>After clearing cache, this works as long no page from another level is loaded. After that it always shows "bar", also on 3 level pages</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3913242018-11-29T14:53:23ZSimon Würstle
<ul></ul><p>What I just found out: when you use "tree.rootLineIds" the caching of all pages which are affected by this condition is deactivated. This does not happen if you use the old syntax.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3971432019-03-25T16:28:20ZStefan Hekele
<ul></ul><p>Can confirm the problem still exists with TYPO3 9.5.5.<br />I'll try to reproduce it with just a core installation.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3971462019-03-25T17:17:20ZStefan Hekele
<ul></ul><p>Steps to reproduce (TYPO3 9.5.5):</p>
<ol>
<li>Create new TYPO3 installation<br />composer create-project typo3/cms-base-distribution typo3_9</li>
<li>Go through install wizard and create backend user, let wizard create empty page</li>
<li>Go into backend, edit typoscript record on start page (uid 1), add the following setup:<br /><pre>
page.5 = TEXT
[tree.level == 0]
page.5.value = level 0
[tree.level == 1]
page.5.value = level 1
[END]
</pre></li>
<li>Create one new subpage, called 1, and enable it</li>
<li>Open <a class="external" href="http://localhost/en/1">http://localhost/en/1</a> (output level 1 => OK)</li>
<li>Open <a class="external" href="http://localhost/">http://localhost/</a> (output level 0 => OK)</li>
<li>Reload <a class="external" href="http://localhost/en/1">http://localhost/en/1</a> (output level 0 => NOT OK)</li>
</ol>
Debugging:
<ol>
<li>Set breakpoint in typo3/sysext/frontend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php at protected function determineRootline()</li>
<li>Open the newly created page (direct subpage of starting page, should match tree.level == 1)
<ol>
<li>Uncached page hit: $GLOBALS["TSFE"]->tmpl->rootLine is filled, and function returns expected array</li>
<li>Cached page hit: $GLOBALS["TSFE"]->tmpl->rootLine is empty, and function returns empty array</li>
</ol></li>
</ol>
<p>Due to determineRootline returning an empty array if the page is already in the cache, <br />$tree created in ConditionMatcher __construct has level 0, and no rootline, nor rootline Ids.</p>
<p>Due to that, all tree conditions evaluate incorrectly for cached pages, not only resulting in incorrect output,<br />but also severely affecting frontend performance due to cache misses.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3971472019-03-25T17:40:28ZStefan Hekele
<ul><li><strong>Subject</strong> changed from <i>TypoScript Condition: rootLineIds not created correctly</i> to <i>TypoScript Condition: tree.* broken on cached pages</i></li></ul> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3972342019-03-27T09:01:50ZDenis Mir
<ul></ul><p>We can confirm this issue as well. Recognized it for "tree.rootLineIds" which works for non cached pages but on cached pages it is not evaluated and we get the default value that we defined.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3972412019-03-27T10:46:28ZSven Juergens
<ul></ul><p>same problem here we use the condition tree.rootlines to change Google Analytics vars.<br />and here we have the problem that the variables are definitely wrong and they still show the rootpage vars.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3995432019-05-06T13:22:18ZDmitry Dulepov
<ul><li><strong>File</strong> <a href="/attachments/34277">m1.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/34277/m1.png">m1.png</a> added</li><li><strong>File</strong> <a href="/attachments/34278">m2.png</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/34278/m2.png">m2.png</a> added</li></ul><p>I can confirm this too. The following causes pages to be never found in cache:</p>
<pre>
[1 in tree.RootLineIds]
</pre>
<p>When generating TSFE->newHash in getFromCache(), matching conditions look like this:</p>
<p><img src="http://forge.typo3.org/attachments/download/34277/m1.png" alt="" loading="lazy" /></p>
<p>But in TSFE->generatePage_preProcessing() it looks like this:</p>
<p><img src="http://forge.typo3.org/attachments/download/34278/m2.png" alt="" loading="lazy" /></p>
<p>Using the fix from Philipp solves the issue.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=3995652019-05-06T16:45:34ZDmitry Dulepov
<ul></ul><p>Update: if you use solr, this will not work. This change works until a proper fix is developed:</p>
<pre>
protected function determineRootline()
{
return (array)($this->getTypoScriptFrontendController()->tmpl->rootLine ?? $this->getTypoScriptFrontendController()->rootLine);
}
</pre> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=4075092019-10-09T13:33:31ZSven Juergens
<ul></ul><p>hello, is this bug still present in the current 9.5.9?<br />I can not reproduce the steps right now</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=4075292019-10-09T14:35:13ZDaniel Siepmanncoding@daniel-siepmann.de
<ul><li><strong>Is duplicate of</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/88374">Bug #88374</a>: [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request</i> added</li></ul> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=4075312019-10-09T14:35:32ZDaniel Siepmanncoding@daniel-siepmann.de
<ul></ul><p>Should be fixed by duplicate issue <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request (Closed)" href="http://forge.typo3.org/issues/88374">#88374</a>.<br />Just added a reference.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=4075622019-10-10T09:03:54ZLars Peter Søndergaardlars.peter@sondergaard.de
<ul></ul><p>I downgraded an installation I'm working on to TYPO3 9.5.7 where this issue still exists and could reproduce the bug.<br />After updating to 9.5.9 again, I could not reproduce it.</p>
<p>So it might be fixed.</p> TYPO3 Core - Bug #86837: TypoScript Condition: tree.* broken on cached pageshttp://forge.typo3.org/issues/86837?journal_id=4075712019-10-10T11:27:25ZSusanne Moogsusanne.moog@typo3.org
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>Closed</i></li></ul><p>Closed as duplicate of <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: [xxx in tree.rootLineIds] TypoScript condition causes page cache regeneration on each request (Closed)" href="http://forge.typo3.org/issues/88374">#88374</a>.</p>