Actions
Bug #20103
closedif.negate dosn't work with if.directReturn
Start date:
2009-02-27
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
It's about the typoscript function "if".
If you use the function "if" in combination with "directReturn" and "negate" the value of "directReturn" will never ever be negated.
(issue imported from #M10564)
Updated by Nabil Saleh over 15 years ago
directReturn is a constant value why should you negate it?
I dont't think this is a bug!
Reference:
http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/5/7/
Updated by Christian Kuhn over 15 years ago
Resolved, won't fix.
It's true that .negate doesn't affect .directReturn, but there are some reasons not to change this behaviour:- It might break backwards compatibility, and bugs in "if" tend to be hard to find
- .directReturn is something like an "early return" that short-circuit the rest of the processing
- I can hardly think of any use-case where .directReturn together with .negate would be usefull
- The documentation of .negate states that it negates the above result (not including directReturn), and directReturn states it returns the value directly. Why should we complicate things here even more?
Please reopen this if you still think this issue needs to be fixed. Please provide a good use-case where this cannot be solved otherwise and think about how not to break existing setups.
Actions