Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of RootCategoryId should be possbile (Magento/Store/Model/Config/Importer/Processor/Create.php) #18956

Closed
larsroettig opened this issue Oct 30, 2018 · 3 comments
Assignees
Labels
Component: Config Component: Store Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@larsroettig
Copy link
Member

larsroettig commented Oct 30, 2018

Description (*)

Currently is not possible to define the root_category_id in the Project config.php

Repro

  • Create a config.php like
  • Run bin/magento -n app:config:import
    'scopes' => [
        'websites' => [
            'admin' => [
                'website_id' => '0',
                'code' => 'admin',
                'name' => 'Admin',
                'sort_order' => '0',
                'default_group_id' => '0',
                'is_default' => '0'
            ],
            'de' => [
                'website_id' => '2',
                'code' => 'de',
                'name' => 'DE',
                'sort_order' => '10',
                'default_group_id' => '2',
                'is_default' => '1'
            ]
        ],
        'groups' => [
            [
                'group_id' => '0',
                'website_id' => '0',
                'code' => 'default',
                'name' => 'Default',
                'root_category_id' => '0',
                'default_store_id' => '0'
            ],
            [
                'group_id' => '2',
                'website_id' => '2',
                'code' => 'de',
                'name' => 'DE',
                'root_category_id' => '2',
                'default_store_id' => '2'
            ]
        ],
        'stores' => [
            'admin' => [
                'store_id' => '0',
                'code' => 'admin',
                'website_id' => '0',
                'group_id' => '0',
                'name' => 'Admin',
                'sort_order' => '0',
                'is_active' => '1'
            ],
            'de_de' => [
                'store_id' => '2',
                'code' => 'de',
                'website_id' => '2',
                'group_id' => '2',
                'name' => ' de DE',
                'sort_order' => '10',
                'is_active' => '1'
            ]
        ]
    ]

Expected behavior (*)

  • Import of root_category_id is successfully

Benefits

  • Simple Store setup for Projects

Additional information

In the import Class will the root category set hardcoded to 0 see:

$website = $this->detectWebsiteById(
$data,
$websiteId
);
$group = $this->groupFactory->create();
$group->setData($groupData);
$group->setRootCategoryId(0);
$group->getResource()->save($group);
$group->getResource()->addCommitCallback(function () use ($data, $group, $website) {

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Oct 30, 2018

Hi @larsroettig. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

@larsroettig do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 30, 2018
@larsroettig larsroettig added Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 30, 2018
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 30, 2018
@larsroettig larsroettig added Component: Store Component: Config Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development labels Oct 30, 2018
@larsroettig larsroettig self-assigned this Oct 30, 2018
@magento-engcom-team
Copy link
Contributor

Hi @larsroettig. Thank you for your report.
The issue has been fixed in #18958 by @larsroettig in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Nov 16, 2018
magento-engcom-team added a commit that referenced this issue Nov 16, 2018
 - Merge Pull Request #18958 from larsroettig/magento2:18956FixesRootCategoryId
 - Merged commits:
   1. 54f4802
   2. 144ea18
   3. 0f575bc
   4. b490fb1
   5. 803cdb1
gelanivishal pushed a commit to gelanivishal/magento2 that referenced this issue Nov 16, 2018
gelanivishal pushed a commit to gelanivishal/magento2 that referenced this issue Nov 16, 2018
gelanivishal pushed a commit to gelanivishal/magento2 that referenced this issue Nov 16, 2018
gelanivishal pushed a commit to gelanivishal/magento2 that referenced this issue Nov 16, 2018
@VladimirZaets
Copy link
Contributor

Hi @larsroettig. Thank you for your report.
The issue has been fixed in #19237 by @gelanivishal in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

@VladimirZaets VladimirZaets added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Nov 21, 2018
magento-engcom-team added a commit that referenced this issue Nov 21, 2018
 - Merge Pull Request #19237 from gelanivishal/magento2:2.2-develop-PR-port-18958
 - Merged commits:
   1. aa4abec
   2. acefdb3
   3. 5866a39
   4. fee2712
   5. 7be21e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Config Component: Store Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

3 participants