Skip to content

Commit 7221211

Browse files
Leonid Poluyanovisitnikov
authored andcommitted
MAGETWO-50224: Inconsistent data during installation of Store
1 parent 1c3981f commit 7221211

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/code/Magento/Catalog/Setup/InstallData.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class InstallData implements InstallDataInterface
3434
*
3535
* @var int
3636
*/
37-
private $defaultCategoryId = 2;
37+
CONST DEFAULT_CATEGORY_ID = 2;
3838

3939
/**
4040
* Init
@@ -73,10 +73,10 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
7373

7474
// Create Default Catalog Node
7575
$category = $categorySetup->createCategory();
76-
$category->load($this->defaultCategoryId)
77-
->setId($this->defaultCategoryId)
76+
$category->load(self::DEFAULT_CATEGORY_ID)
77+
->setId(self::DEFAULT_CATEGORY_ID)
7878
->setStoreId(0)
79-
->setPath($this->rootCategoryId . '/' . $this->defaultCategoryId)
79+
->setPath($this->rootCategoryId . '/' . self::DEFAULT_CATEGORY_ID)
8080
->setName('Default Category')
8181
->setDisplayMode('PRODUCTS')
8282
->setIsActive(1)

app/code/Magento/Store/Setup/InstallSchema.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\Setup\ModuleContextInterface;
1111
use Magento\Framework\Setup\SchemaSetupInterface;
1212
use \Magento\Framework\DB\Ddl\Table;
13+
use \Magento\Catalog\Setup\InstallData;
1314

1415
/**
1516
* @codeCoverageIgnore
@@ -259,7 +260,7 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
259260
'group_id' => 1,
260261
'website_id' => 1,
261262
'name' => 'Main Website Store',
262-
'root_category_id' => 2,
263+
'root_category_id' => InstallData::DEFAULT_CATEGORY_ID,
263264
'default_store_id' => 1
264265
]
265266
);

0 commit comments

Comments
 (0)