Skip to content

Commit 567baf7

Browse files
committed
MC-29473: Strange changes in the URL structure for subcategories
1 parent 7abeb2e commit 567baf7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

setup/src/Magento/Setup/Fixtures/CategoriesFixture.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Catalog\Model\Category;
1010
use Magento\Catalog\Model\CategoryFactory;
1111
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
12+
use Magento\Store\Model\Store;
1213
use Magento\Store\Model\StoreManager;
1314

1415
/**
@@ -82,7 +83,7 @@ public function __construct(
8283
protected $priority = 20;
8384

8485
/**
85-
* {@inheritdoc}
86+
* @inheritdoc
8687
*/
8788
public function execute()
8889
{
@@ -97,7 +98,7 @@ public function execute()
9798
$category = $this->categoryFactory->create();
9899
$category->load($parentCategoryId);
99100
// Need for generation url rewrites per all category store view
100-
$category->setStoreId(\Magento\Store\Model\Store::DEFAULT_STORE_ID);
101+
$category->setStoreId(Store::DEFAULT_STORE_ID);
101102
$categoryIndex = 1;
102103
$this->generateCategories(
103104
$category,
@@ -130,6 +131,7 @@ private function generateCategories(
130131
$category->setId(null)
131132
->setUrlKey(null)
132133
->setUrlPath(null)
134+
->setStoreId(Store::DEFAULT_STORE_ID)
133135
->setName($this->getCategoryName($parentCategory, $nestingLevel, $i))
134136
->setParentId($parentCategory->getId())
135137
->setLevel($parentCategory->getLevel() + 1)
@@ -237,15 +239,15 @@ private function getCategoryPrefix()
237239
}
238240

239241
/**
240-
* {@inheritdoc}
242+
* @inheritdoc
241243
*/
242244
public function getActionTitle()
243245
{
244246
return 'Generating categories';
245247
}
246248

247249
/**
248-
* {@inheritdoc}
250+
* @inheritdoc
249251
*/
250252
public function introduceParamLabels()
251253
{

0 commit comments

Comments
 (0)