Skip to content

Commit bac82cc

Browse files
committed
Prevent Category URL Rewrites generation when no Store Group assigned
1 parent f25fc03 commit bac82cc

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

app/code/Magento/CatalogUrlRewrite/Model/Category/Plugin/Store/View.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ public function afterSave(
104104
Store $object,
105105
Store $store
106106
): Store {
107-
if ($this->origStore->isObjectNew() || $this->origStore->dataHasChangedFor('group_id')) {
107+
if (
108+
$this->origStore->getData('group_id')
109+
&& ($this->origStore->isObjectNew() || $this->origStore->dataHasChangedFor('group_id'))
110+
) {
108111
$categoryRewriteUrls = $this->generateCategoryUrls(
109112
(int)$this->origStore->getRootCategoryId(),
110113
(int)$this->origStore->getId()

0 commit comments

Comments
 (0)