Skip to content

Commit 0ce20e3

Browse files
MC-40371: Moving category in hierarchy causes url_path to be incorrect
1 parent 00a70ec commit 0ce20e3

File tree

1 file changed

+5
-7
lines changed
  • app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category

1 file changed

+5
-7
lines changed

app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category/Move.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,11 @@ public function afterChangeParent(
6767
$categoryStoreId = $category->getStoreId();
6868
foreach ($category->getStoreIds() as $storeId) {
6969
$category->setStoreId($storeId);
70-
if (!$this->isGlobalScope($storeId)) {
71-
$this->updateCategoryUrlKeyForStore($category);
72-
$category->unsUrlPath();
73-
$category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category));
74-
$category->getResource()->saveAttribute($category, 'url_path');
75-
$this->updateUrlPathForChildren($category);
76-
}
70+
$this->updateCategoryUrlKeyForStore($category);
71+
$category->unsUrlPath();
72+
$category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category));
73+
$category->getResource()->saveAttribute($category, 'url_path');
74+
$this->updateUrlPathForChildren($category);
7775
}
7876
$category->setStoreId($categoryStoreId);
7977

0 commit comments

Comments
 (0)