From e100822f5858d5c218cfb72a76478ff3db194a26 Mon Sep 17 00:00:00 2001 From: Barny Shergold Date: Mon, 22 Jun 2020 15:21:22 +0100 Subject: [PATCH] Reversed change --- .../CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php index 118bd17ddd604..cba9218ce7c72 100644 --- a/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php +++ b/app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php @@ -73,7 +73,10 @@ public function getUrlPath($category, $parentCategory = null) if (in_array($category->getParentId(), [Category::ROOT_CATEGORY_ID, Category::TREE_ROOT_ID])) { return ''; } - + $path = $category->getUrlPath(); + if ($path !== null && !$category->dataHasChangedFor('url_key') && !$category->dataHasChangedFor('parent_id')) { + return $path; + } $path = $category->getUrlKey(); if ($path === false) { return $category->getUrlPath();