[BUGFIX] Respect mountpoint variable in cObj menu runtime cache 32/57532/5
authorSascha Egerer <sascha@sascha-egerer.de>
Wed, 11 Jul 2018 14:59:22 +0000 (16:59 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 30 Sep 2018 11:45:21 +0000 (13:45 +0200)
The mountpoint variable must be respected in the key used for the
menu runtime cache. Without that part in the key all links generated
to a mount-point sub-page will link to the first mount target page
in the menu.

Resolves: #80970
Resolves: #62248
Releases: master, 8.7, 7.6
Change-Id: I8ccfebabd515d6da9f78388de51d24603e9fe532
Reviewed-on: https://review.typo3.org/57532
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index 19ad6b1..6397324 100644 (file)
@@ -1665,14 +1665,14 @@ abstract class AbstractMenuContentObject
     protected function link($key, $altTarget = '', $typeOverride = '')
     {
         $runtimeCache = $this->getRuntimeCache();
-        $cacheId = 'menu-generated-links-' . md5($key . $altTarget . $typeOverride . serialize($this->menuArr[$key]));
+        $MP_var = $this->getMPvar($key);
+        $cacheId = 'menu-generated-links-' . md5($key . $altTarget . $typeOverride . $MP_var . serialize($this->menuArr[$key]));
         $runtimeCachedLink = $runtimeCache->get($cacheId);
         if ($runtimeCachedLink !== false) {
             return $runtimeCachedLink;
         }
 
         // Mount points:
-        $MP_var = $this->getMPvar($key);
         $MP_params = $MP_var ? '&MP=' . rawurlencode($MP_var) : '';
         // Setting override ID
         if ($this->mconf['overrideId'] || $this->menuArr[$key]['overrideId']) {