Project

General

Profile

Actions

Feature #68613

closed

TypoScript: NOT EQUALS condition operator for condition: [applicationContext]

Added by Christian Weiske over 9 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2015-07-29
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

It would be helpful if there was a "not equals" operator in typoscript conditions, !=.

Goal is to check if an applicationContext is NOT Development.

Actions #1

Updated by Riccardo De Contardi about 9 years ago

  • Subject changed from TypoScript: NOT EQUALS condition operator to TypoScript: NOT EQUALS condition operator for condition: [applicationContext]

I change the subject because some conditions already have the operator "!=":

hour,minute,month,year ,dayofweek,dayofmonth, dayofyear,globalVar
Actions #2

Updated by Benni Mack over 8 years ago

  • Status changed from New to Needs Feedback

Hey Christian,

unfortunately this is not so easy to implement, as the applicationContext condition only has one "=" as comparator, thus the ConditionMatcher cannot evaluate the comparison parameter. additionally, we have the problem that you can add a comma-separated list which also works (without the "=") as a equals symbol as well,

I would therefore suggest to do it like this:
[applicationContext = Testing, Production]
THIS IS EVERYTHING EXCEPT DEVELOPMENT

or
[applicationContext = Development]
[else]
[end]

I fear if we add this feature for applicationContext, we'd need to add it to the other missing conditions as well, making it a real breaking change for all TypoScripts out there.

btw: The !=/>/< is only implemented for number comparisons (year, globalVar, etc) currently.

Actions #3

Updated by Helmut Hummel over 8 years ago

Just a side note on ApplicationContext:

There are only two valid main contexts, which are "Production" and "Development". "Testing" is internal and must only be used in TYPO3 core tests.

Actions #4

Updated by Riccardo De Contardi almost 8 years ago

  • Status changed from Needs Feedback to Closed

Closed:
- number comparison conditions will remain the only ones that have the "!=/>/<" comparison operators for now.
- there are some alternatives to obtain the "!=" like using [else]

If you think that this is the wrong decision or that more work should be done on this area please reopen it.

Thank you

Actions

Also available in: Atom PDF