Skip to content

Commit e100822

Browse files
Barny ShergoldBarny Shergold
authored andcommitted
Reversed change
1 parent ac1ac06 commit e100822

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ public function getUrlPath($category, $parentCategory = null)
7373
if (in_array($category->getParentId(), [Category::ROOT_CATEGORY_ID, Category::TREE_ROOT_ID])) {
7474
return '';
7575
}
76-
76+
$path = $category->getUrlPath();
77+
if ($path !== null && !$category->dataHasChangedFor('url_key') && !$category->dataHasChangedFor('parent_id')) {
78+
return $path;
79+
}
7780
$path = $category->getUrlKey();
7881
if ($path === false) {
7982
return $category->getUrlPath();

0 commit comments

Comments
 (0)