Commit 5569bee6 authored by Andreas Allacher's avatar Andreas Allacher Committed by Frank Nägler
Browse files

[FEATURE] TypoScript condition add GPmerged

If one uses TypoScript condition with GP then the check is with
GeneralUtility::_GP() which will means that if I have GET variables
beginning with an extbase plugin-namespace and POST variables with
the same plugin-namespace, e.g.
GET: tx_demo_demo[action]=detail
POST: tx_demo_demo[name]=Foo

then GeneralUtility::_GP('tx_demo_demo'), as intended, will only
return the array of the POST variables for that namespace.

However, that results in the issue that if I check for the GET variable
the check will fail.

So for such cases there is a new TypoScript condition
GPmerged which uses GeneralUtility::_GPmerged()

Change-Id: I772c1c1d178b10e9293132bc41bfc36fabd53063
Resolves: #65250
Releases: master
Reviewed-on: http://review.typo3.org/37157

Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarMichael Oehlhof <typo3@oehlhof.de>
Reviewed-by: default avatarFrank Nägler <typo3@naegler.net>
Tested-by: default avatarFrank Nägler <typo3@naegler.net>
parent ed8d2151
......@@ -514,6 +514,9 @@ abstract class AbstractConditionMatcher {
case 'GP':
$value = GeneralUtility::_GP($k);
break;
case 'GPmerged':
$value = GeneralUtility::_GPmerged($k);
break;
case 'ENV':
$value = getenv($k);
break;
......
===================================================
Feature: #65250 - TypoScript condition add GPmerged
===================================================
Description
===========
If one uses TypoScript condition with GP then the check is with GeneralUtility::_GP()
which will means that if I have GET variables beginning with an extbase plugin-namespace
and POST variables with the same plugin-namespace, e.g.
GET: tx_demo_demo[action]=detail
POST: tx_demo_demo[name]=Foo
then GeneralUtility::_GP('tx_demo_demo'), as intended, will only return the
array of the POST variables for that namespace. However, that results in the issue that
if I check for the GET variable the check will fail.
So, instead the check should use GeneralUtility::_GPmerged()
.. code-block:: typoscript
[globalVar = GPmerged:tx_demo|foo = 1]
page.90 = TEXT
page.90.value = DEMO
[global]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment