http://forge.typo3.org/http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?17058661692019-09-13T09:00:17ZTYPO3 ForgeTYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4059202019-09-13T09:00:17ZClaus Dueclaus@phpmind.net
<ul></ul><p>Can you add a bit more information - for example:</p>
<ul>
<li>What is the template code?</li>
<li>What are the variables involved with the expression?</li>
<li>What is the context (inside or outside ViewHelper arguments)?</li>
<li>What is your PHP version?</li>
</ul> TYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4059242019-09-13T10:31:53ZStig Nørgaard Færch
<ul></ul><p>Claus Due wrote:</p>
<blockquote>
<p>Can you add a bit more information - for example:</p>
</blockquote>
<p>Sorry for not supplying with much data on the issue.<br />I was also a bit too quick to blame the shift from typo3fluid/fluid 2.6.1 to 2.6.2, as downgrading does not seem to fix anything.<br />Also, I'm not sure at what point it stopped working, or if it have been working at all then.<br />The thing I can conclude though, is that it still doesn't work as I expect.</p>
<blockquote>
<ul>
<li>What is the template code?</li>
<li>What are the variables involved with the expression?</li>
<li>What is the context (inside or outside ViewHelper arguments)?</li>
</ul>
</blockquote>
<p>Instead of showing my code, just trying out the example from usetypo3.com also demonstrates the problem on my installation</p>
<pre>
<f:variable name="variableToCheck" value="0" />
<f:variable name="option1" value="Option one" />
<f:variable name="option2" value="Option two" />
One of two options: {variableToCheck ? option1 : option2}<br/>
Fallback if variable not set: {option1 ? option1 : option2}<br/>
</pre>
<p>This should output:<br />One of two options: Option two<br />Fallback if variable not set: Option one</p>
<p>But instead it outputs:<br />One of two options: Option one<br />Fallback if variable not set: Option one</p>
<blockquote>
<ul>
<li>What is your PHP version?</li>
</ul>
</blockquote>
<p>Local: PHP 7.2.1 (MAMP)<br />Server: PHP 7.2.22</p> TYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4059292019-09-13T12:11:03ZJarvis H
<ul></ul><p>I believe it may be the issue described here: <a class="external" href="https://github.com/TYPO3/Fluid/issues/389">https://github.com/TYPO3/Fluid/issues/389</a></p>
<p>The viewhelper only checks for null values, and '0' is not null.</p> TYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4062192019-09-19T20:32:03ZClaus Dueclaus@phpmind.net
<ul></ul><p><a class="external" href="https://github.com/TYPO3/Fluid/issues/389">https://github.com/TYPO3/Fluid/issues/389</a> is very unlikely to be related unless you also used `f:or` - the ternary condition does not use the same condition logic; and `f:or` is designed explicitly to only trigger alternative on null.</p>
<p>I am unable to confirm the problem. Fluid 2.x performs the code correctly:</p>
<pre>
pro:~ claus$ ./vendor/bin/fluid
<f:variable name="variableToCheck" value="0" />
<f:variable name="option1" value="Option one" />
<f:variable name="option2" value="Option two" />
One of two options: {variableToCheck ? option1 : option2}<br/>
Fallback if variable not set: {option1 ? option1 : option2}<br/>
^D
One of two options: Option two<br/>
Fallback if variable not set: Option one<br/>
</pre>
<p>You can test yourself using the command. Enter the Fluid code and disconnect (CTRL-D) to render.</p> TYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4117922019-12-20T10:18:43ZRiccardo De Contardierredeco@gmail.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs Feedback</i></li></ul><p>@Stig Nørgaard Færch</p>
<p>May I ask you if you still are able to reproduce this issue?</p> TYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4176272020-03-05T11:20:18ZGeorg Ringer
<ul></ul><p>I am closing this issue because lack of feedback. feel free to open a new issue and reference this one if still valid</p> TYPO3 Core - Bug #89159: Ternary condtions stopped working...http://forge.typo3.org/issues/89159?journal_id=4183122020-03-09T00:33:06ZGeorg Ringer
<ul><li><strong>Status</strong> changed from <i>Needs Feedback</i> to <i>Closed</i></li></ul>