Skip to content

[TASK] Solve issue #14966 - Disabling product does not remove it from… #15019

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

Merged
merged 5 commits into from
Jun 7, 2018

Conversation

lewisvoncken
Copy link
Contributor

… the flat index

Description

When you disable a product it should be removed from the flat table

Fixed Issues (if relevant)

  1. Disabling product does not remove it from the flat index #14966: Disabling product does not remove it from the flat index

Manual testing scenarios

  1. Install Magento 2.2.3 together with the sample data set.
  2. Make sure cron is run every minute (bin/magento cron:run).
  3. Make sure the config setting Use Flat Catalog Product is set to Yes.
  4. Make sure the flat index is up-to-date: bin/magento index:reindex catalog_product_flat.
  5. Choose an enabled product in the Magento admin backend. Say its ID is X.
  6. Make sure that there exists an entry in table catalog_product_flat_1 with entity_id = X. If not, you've done something wrong.
  7. Now, in the Magento admin backend, disable the product.
  8. Wait a few minutes.
  9. Check whether the table catalog_product_flat_1 still contains an entry with entity_id = X.

Expected result

  1. The table catalog_product_flat_1 should contain no entry with entity_id = X.

Actual result

  1. The table catalog_product_flat_1 contains an entry with entity_id = X.

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)

@@ -41,7 +48,8 @@ public function __construct(
TableBuilder $tableBuilder,
FlatTableBuilder $flatTableBuilder,
Indexer $flatItemWriter,
Eraser $flatItemEraser
Eraser $flatItemEraser,
MetadataPool $metadataPool
Copy link
Contributor

Choose a reason for hiding this comment

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

@lewisvoncken, due to Magento backward-compatible guide we can't add a new required dependency to the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@VladimirZaets thanks for the feedback. The dependency incorrect and I have just removed it.

@ishakhsuvarov
Copy link
Contributor

Hi @lewisvoncken
I am going to run some more tests with internal CICD, including performance and functional, and proceed with processing, if it's all good.
I've noticed you have created a branch in the magento/magento2 for this Pull Request. It is not really encouraged, so please use your own fork in the future

Thanks

@lewisvoncken
Copy link
Contributor Author

@ishakhsuvarov

next time I will use the fork. Thanks for looking into this pull request!

@okorshenko okorshenko removed this from the May 2018 milestone May 31, 2018
@magento-engcom-team magento-engcom-team merged commit 219024c into 2.2-develop Jun 7, 2018
magento-engcom-team pushed a commit that referenced this pull request Jun 7, 2018
@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.6 release.

Please, consider to port this solution to 2.3 release line.
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
Labels
Partner: Experius partners-contribution Pull Request is created by Magento Partner Release Line: 2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants