[FEATURE] TypoScript condition add GPmerged 57/37157/10
authorAndreas Allacher <andreas.allacher@gmx.at>
Tue, 24 Feb 2015 09:25:15 +0000 (10:25 +0100)
committerFrank Nägler <typo3@naegler.net>
Sun, 17 May 2015 21:03:34 +0000 (23:03 +0200)
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 <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Frank Nägler <typo3@naegler.net>
Tested-by: Frank Nägler <typo3@naegler.net>
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Documentation/Changelog/master/Feature-65250-TypoScriptConditionAddGPmerged.rst [new file with mode: 0644]

index b566be6..be401c9 100644 (file)
@@ -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;
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-65250-TypoScriptConditionAddGPmerged.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-65250-TypoScriptConditionAddGPmerged.rst
new file mode 100644 (file)
index 0000000..ad73fc5
--- /dev/null
@@ -0,0 +1,25 @@
+===================================================
+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]