[BUGFIX] Prevent exception due to missing id in the language menu 43/49943/7
authorSascha Nowak <sascha.nowak@netlogix.de>
Thu, 15 Sep 2016 12:07:59 +0000 (14:07 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 13 Oct 2016 07:51:02 +0000 (09:51 +0200)
Make sure the "id" parameter is set when using
"addQueryString.exclude" to prevent the exception in the cHash
calculation when "cHashIncludePageId" is set to true.

Change-Id: I170d2c38931b52c1c50968f7ef343c3a11dc5937
Resolves: #77956
Releases: master, 7.6, 6.2
Reviewed-on: https://review.typo3.org/49943
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Maik Peuser <maik.peuser@verdure.de>
Reviewed-by: Andreas Bouche <andreas.bouche@flagbit.de>
Tested-by: Andreas Bouche <andreas.bouche@flagbit.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index 67fbacc..6a929de 100644 (file)
@@ -1170,6 +1170,9 @@ abstract class AbstractMenuContentObject
     {
         $parameters = GeneralUtility::explodeUrl2Array($queryString);
         if (!empty($parameters)) {
+            if (!isset($parameters['id'])) {
+                $queryString .= '&id=' . $this->getTypoScriptFrontendController()->id;
+            }
             /** @var CacheHashCalculator $cacheHashCalculator */
             $cacheHashCalculator = GeneralUtility::makeInstance(CacheHashCalculator::class);
             $cHashParameters = $cacheHashCalculator->getRelevantParameters($queryString);