From 31e4183639751eb7d49a4d1e6f2c9b1fcf5ecaea Mon Sep 17 00:00:00 2001 From: Evgeni Date: Wed, 30 Jan 2019 23:50:43 +0300 Subject: [PATCH 1/2] Fix UrlRewriteGenerator for anchor categories --- .../Model/Product/AnchorUrlRewriteGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php index a7cc894c9a022..c382d5f826386 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php @@ -61,7 +61,7 @@ public function generate($storeId, Product $product, ObjectRegistry $productCate $anchorCategoryIds = $category->getAnchorsAbove(); if ($anchorCategoryIds) { foreach ($anchorCategoryIds as $anchorCategoryId) { - $anchorCategory = $this->categoryRepository->get($anchorCategoryId); + $anchorCategory = $this->categoryRepository->get($anchorCategoryId, $storeId); $urls[] = $this->urlRewriteFactory->create() ->setEntityType(ProductUrlRewriteGenerator::ENTITY_TYPE) ->setEntityId($product->getId()) From 123e3accb1f2c321ceec8eb1da5a12ab9bd857a2 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Mon, 11 Mar 2019 12:05:38 +0200 Subject: [PATCH 2/2] ENGCOM-4076: Static test fix. --- .../Model/Product/AnchorUrlRewriteGenerator.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php index c382d5f826386..8511986cf0021 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/Product/AnchorUrlRewriteGenerator.php @@ -14,6 +14,9 @@ use Magento\UrlRewrite\Service\V1\Data\UrlRewrite; use Magento\UrlRewrite\Service\V1\Data\UrlRewriteFactory; +/** + * Url rewrite generator for anchor categories. + */ class AnchorUrlRewriteGenerator { /**