From 8bcd2fa8839cd3f0fb659d49ee1590b664b9687c Mon Sep 17 00:00:00 2001 From: Fabian Schmengler Date: Fri, 8 May 2020 15:54:36 +0200 Subject: [PATCH] Refactor: remove redundant check --- .../CatalogUrlRewrite/Model/CategoryUrlRewriteGenerator.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGenerator.php index 5775d6dffee4a..f32cd77433c17 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlRewriteGenerator.php @@ -124,13 +124,11 @@ protected function generateForGlobalScope( $mergeDataProvider = clone $this->mergeDataProviderPrototype; $categoryId = $category->getId(); foreach ($category->getStoreIds() as $storeId) { - if ($storeId !== Store::DEFAULT_STORE_ID) { - $category = clone $category; // prevent undesired side effects on original object - } - $category->setStoreId($storeId); if (!$this->isGlobalScope($storeId) && $this->isOverrideUrlsForStore($storeId, $categoryId, $overrideStoreUrls) ) { + $category = clone $category; // prevent undesired side effects on original object + $category->setStoreId($storeId); $this->updateCategoryUrlForStore($storeId, $category); $mergeDataProvider->merge($this->generateForSpecificStoreView($storeId, $category, $rootCategoryId)); }