Last active
January 6, 2020 11:32
-
-
Save tdgroot/f4c600ae1be9f5ab5b7f41a7058360e4 to your computer and use it in GitHub Desktop.
Fixes issue https://github.com/magento/magento2/issues/22407. Patch originating from commit https://github.com/magento/magento2/commit/bd5b7c584de95da97200be47d6f63fd9eda372f7.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/Plugin/Block/Topmenu.php | |
+++ b/Plugin/Block/Topmenu.php | |
@@ -193,4 +193,21 @@ protected function getCategoryTree($storeId, $rootId) | |
return $collection; | |
} | |
+ | |
+ /** | |
+ * Add active | |
+ * | |
+ * @param \Magento\Theme\Block\Html\Topmenu $subject | |
+ * @param string[] $result | |
+ * @return string[] | |
+ */ | |
+ public function afterGetCacheKeyInfo(\Magento\Theme\Block\Html\Topmenu $subject, array $result) | |
+ { | |
+ $activeCategory = $this->getCurrentCategory(); | |
+ if ($activeCategory) { | |
+ $result[] = Category::CACHE_TAG . '_' . $activeCategory->getId(); | |
+ } | |
+ | |
+ return $result; | |
+ } | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment