Skip to content

Commit e4ea0d0

Browse files
committed
MC-34483: Moving a store view to a different website resets URLs
1 parent db7f348 commit e4ea0d0

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public function afterSave(
106106
): Store {
107107
if ($this->origStore->isObjectNew() || $this->origStore->dataHasChangedFor('group_id')) {
108108
$categoryRewriteUrls = $this->generateCategoryUrls(
109-
$this->origStore->getRootCategoryId(),
110-
$this->origStore->getId()
109+
(int)$this->origStore->getRootCategoryId(),
110+
(int)$this->origStore->getId()
111111
);
112112

113113
$this->urlPersist->replace($categoryRewriteUrls);
@@ -135,7 +135,7 @@ protected function generateProductUrls(int $storeId): array
135135
->addAttributeToSelect(['name', 'url_path', 'url_key', 'visibility'])
136136
->addStoreFilter($storeId);
137137
foreach ($collection as $product) {
138-
/** @var \Magento\Catalog\Model\Product $product */
138+
/** @var Product $product */
139139
$product->setStoreId($storeId);
140140
$urls[] = $this->productUrlRewriteGenerator->generate($product);
141141
}

0 commit comments

Comments
 (0)