[BUGFIX] Prevent exception due to missing id in the language menu 05/50205/2
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 08:07:00 +0000 (10:07 +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/50205
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index 392626b..d0460bb 100644 (file)
@@ -1171,6 +1171,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);