Skip to content

Commit b869450

Browse files
committed
MAGETWO-90332: URL rewrite for store is not created for child if parent category has non-default URL key on store
1 parent 57fecb4 commit b869450

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(
6060
}
6161

6262
/**
63-
* Perform url updating for different stores
63+
* Perform url updating for different stores.
6464
*
6565
* @param CategoryResource $subject
6666
* @param CategoryResource $result
@@ -76,7 +76,8 @@ public function afterSave(
7676
$parentCategoryId = $category->getParentId();
7777
if ($category->isObjectNew()
7878
&& !$category->isInRootCategoryList()
79-
&& !empty($parentCategoryId)) {
79+
&& !empty($parentCategoryId)
80+
) {
8081
foreach ($category->getStoreIds() as $storeId) {
8182
if (!$this->isGlobalScope((int)$storeId)
8283
&& $this->storeViewService->doesEntityHaveOverriddenUrlPathForStore(
@@ -96,17 +97,19 @@ public function afterSave(
9697
}
9798

9899
/**
99-
* Check that store id is in global scope
100+
* Check that store id is in global scope.
100101
*
101102
* @param int $storeId
102103
* @return bool
103104
*/
104105
private function isGlobalScope(int $storeId): bool
105106
{
106-
return null === $storeId || $storeId === Store::DEFAULT_STORE_ID;
107+
return $storeId === Store::DEFAULT_STORE_ID;
107108
}
108109

109110
/**
111+
* Updates category url path.
112+
*
110113
* @param Category $category
111114
* @param CategoryResource $categoryResource
112115
* @return void

0 commit comments

Comments
 (0)