Skip to content

Conversation

@lewisvoncken
Copy link
Contributor

reopen #13446

…et to 0 for new products when using index on save

Description

If you use the \Magento\Framework\Api\SearchCriteriaBuilder and the flat product row_id is set to 0. The product isn't shown in the getList of the ProductRepository

Manual testing scenarios

Issue was in the Commerce (EE) version but can be solved in the Open Source Codebase

  1. Enable Product Flat Catalog Stores > Settings > Configuration > Catalog > Catalog > Storefront > Use Flat Catalog Product
  2. Run the index manually through the command line php bin/magento indexer:reindex catalog_product_flat
  3. Set the Indexes to On Save System > Tools > Index Management > Select all and select the action Update on Save
  4. Create a New Product with SKU test
  5. Take a look in the database in the catalog_product_flat_1 tabel and search for the product with SKU test
  6. The row_id will be set to 0
  7. Apply Changes
  8. Save the Product
  9. Take a look at the database in the catalog_product_flat_1 tabel and search for the product with SKU test
  10. The row_id should now be equal to the entity_id

Besides looking in the database you could create a simpel collection by using the SearchCritieria and the ProductRepository

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)

@magento-engcom-team
Copy link
Contributor

Hi @lewisvoncken. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.5 release.

Please, consider porting this solution across release lines.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants