Project

General

Profile

Actions

Bug #20103

closed

if.negate dosn't work with if.directReturn

Added by Ole Fritz about 15 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
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)

Actions #1

Updated by Nabil Saleh almost 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/

Actions #2

Updated by Christian Kuhn almost 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 #3

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF