[!!!][BUGFIX] Add all parameters to a shortcut page 85/49785/6
authorTomita Militaru <militarutomita@gmail.com>
Fri, 2 Sep 2016 17:06:59 +0000 (19:06 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sat, 3 Sep 2016 13:30:27 +0000 (15:30 +0200)
Except for type and configured linkVars, all other
parameters from a shortcut page were ignored and this
patch adds "addQueryString" to the typolink call.

Resolves: #38496
Releases: master
Change-Id: Ib73760f29428492f09b7e2bb63ac4379d7cc7600
Reviewed-on: https://review.typo3.org/49785
Reviewed-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Tested-by: Alexander Stehlik <alexander.stehlik@gmail.com>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Breaking-38496-AddAllParametersToAShortcutPage.rst [new file with mode: 0644]
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-38496-AddAllParametersToAShortcutPage.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-38496-AddAllParametersToAShortcutPage.rst
new file mode 100644 (file)
index 0000000..38d7c21
--- /dev/null
@@ -0,0 +1,48 @@
+
+.. include:: ../../Includes.txt
+
+===============================================================
+Breaking: #38496 - Shortcut redirects append all URL parameters
+===============================================================
+
+Description
+===========
+
+When a user accesses a shortcut page, all provided URL parameters are appended to
+the target URL.
+
+**Example:**
+
+Page with UID 2 is a shortcut to page with UID 1 and these `linksVars` are configured:
+
+.. code-block:: typoscript
+
+   config.linkVars = L
+
+..
+
+Old behavior:
+
+http://mydomain.tld?id=2&L=1&customparam=X will redirect to http://mydomain.tld?id=1&L=1
+
+New behavior:
+
+http://mydomain.tld?id=2&L=1&customparam=X will redirect to http://mydomain.tld?id=1&L=1&customparam=X
+
+
+Impact
+======
+
+The target URL of a shortcut may change when additional parameters are provided in the URL.
+
+
+Affected Installations
+======================
+
+All installations using shortcut pages are affected.
+
+
+Migration
+=========
+
+There is no migration available.
index cb3d27c..ec563bc 100644 (file)
@@ -2982,7 +2982,8 @@ class TypoScriptFrontendController
         if ($type && MathUtility::canBeInterpretedAsInteger($type)) {
             $parameter .= ',' . $type;
         }
         if ($type && MathUtility::canBeInterpretedAsInteger($type)) {
             $parameter .= ',' . $type;
         }
-        $redirectUrl = $cObj->typoLink_URL(['parameter' => $parameter]);
+        $redirectUrl = $cObj->typoLink_URL(['parameter' => $parameter, 'addQueryString' => true,
+            'addQueryString.' => ['exclude' => 'id']]);
 
         // Prevent redirection loop
         if (!empty($redirectUrl)) {
 
         // Prevent redirection loop
         if (!empty($redirectUrl)) {