Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.

magento-engcom/import-export-improvements#88: Set store id on import product category initialization to 0 #112

Conversation

pogster
Copy link
Contributor

@pogster pogster commented Jun 16, 2018

Description

It seems that the \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection will always, when there is no store id supplied, set it to the value supplied by $this->_storeManager->getStore()->getId()) (= 1 for example).
This will result in store 1 values being used to identify the categories on product import instead of the values from admin scope (store 0).

The core behaviour may be questionable, but we can just set it to 0 in our \Model\Import\Product\CategoryProcessor to avoid this.

Fixed Issues (if relevant)

  1. CatalogImportExport categoryProcessor is using default store id values #88

Manual testing scenarios

Reproduction as described in #88 (short version):

  • Create a category 'Test'
  • Set the category name to something completely different on default storeview
  • Create a csv with catalog product data
  • Set 'Default Category/Test' as the 'categories' value
  • Import

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

…o 0. Would otherwise be null and set to 1 in \Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection::getStoreId, leading to unwanted store values for category names.
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Jun 16, 2018

CLA assistant check
All committers have signed the CLA.

@pogster pogster changed the title FIx magento-engcom/import-export-improvements#88: Set store id on import product category initialization to 0 Fix magento-engcom/import-export-improvements#88: Set store id on import product category initialization to 0 Jun 16, 2018
@pogster pogster changed the title Fix magento-engcom/import-export-improvements#88: Set store id on import product category initialization to 0 magento-engcom/import-export-improvements#88: Set store id on import product category initialization to 0 Jun 16, 2018
…For category identification, admin name must be used.
@pogster
Copy link
Contributor Author

pogster commented Jul 1, 2018

Solved the integration test problem by adjusting the test csv used... obviously it was meant to be using storeId 1 value for identification of the category (!?).

Copy link
Contributor

@kokoc kokoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.0 milestone Jul 9, 2018
@magento-engcom-team magento-engcom-team merged commit 2e04d50 into magento-engcom:2.3-develop Jul 18, 2018
magento-engcom-team added a commit that referenced this pull request Jul 20, 2018
 - Merge Pull Request magento/graphql-ce#112 from magento/graphql-ce:19-add-breadcrumbs-support
 - Merged commits:
   1. 34ed6d1
   2. 78a67c3
   3. 3d973af
   4. cfd7502
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants