Skip to content

Commit c60761e

Browse files
committed
MAGETWO-95539: [2.3] Moving Category generate duplicate url_rewrite when 4th level category exist and is translated
- Fixed url rewrites regeneration after category moving
1 parent 36c9718 commit c60761e

File tree

1 file changed

+4
-0
lines changed
  • app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Category

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,19 @@ public function afterChangeParent(
6464
Category $newParent,
6565
$afterCategoryId
6666
) {
67+
68+
$categoryStoreId = $category->getStoreId();
6769
foreach ($category->getStoreIds() as $storeId) {
6870
$category->setStoreId($storeId);
6971
if (!$this->isGlobalScope($storeId)) {
7072
$this->updateCategoryUrlKeyForStore($category);
73+
$category->unsUrlPath();
7174
$category->setUrlPath($this->categoryUrlPathGenerator->getUrlPath($category));
7275
$category->getResource()->saveAttribute($category, 'url_path');
7376
$this->updateUrlPathForChildren($category);
7477
}
7578
}
79+
$category->setStoreId($categoryStoreId);
7680

7781
return $result;
7882
}

0 commit comments

Comments
 (0)