Skip to content

Deleting disabled category forces category flat and catalog search re-indexed fully #32082

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 12 commits into from
Mar 7, 2021

Conversation

engcom-Charlie
Copy link
Contributor

@engcom-Charlie engcom-Charlie commented Feb 10, 2021

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes Deleting disabled category forces category flat and catalog search re-indexed fully #23297

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

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 are green)

@engcom-Charlie
Copy link
Contributor Author

@magento run all tests

@engcom-Charlie
Copy link
Contributor Author

@magento run all tests

@danielrussob
Copy link

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @danielrussob. Thank you for your request. I'm working on Magento instance for you.

@danielrussob
Copy link

@magento give me test instance

@magento-deployment-service
Copy link

Hi @danielrussob. Thank you for your request. I'm working on Magento instance for you.

@magento-deployment-service
Copy link

public function testDeleteInactiveCategory(): void
{
$this->indexer->reindexAll();
$indexerShouldBeValid = $this->indexer->isInvalid();
Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @engcom-Charlie thanks for your contribution!

The name of $indexerShouldBeValid variable wasn't very intuitive to me, it didn't give me the idea that we were getting the state of the indexer.

What about renaming with something like $isInvalidIndexer?

This way the assertion $this->assertFalse($isInvalidIndexer) becomes more readable too.

What do you think?

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

Manual testing scenario

  1. From Admin Panel, go to Catalog - Categories
  2. Click Add Subcategory
  3. Type a Category Name
  4. Set Enable Category to No
  5. Save category
  6. Go to System - Index Management
  7. Select All Indexers and Submit Update by schedule
  8. Run bin/magento indexer:reindex and assert that all the indexers are in Status - Ready (green)
  9. Go to Catalog - Categories and Delete the previously created disabled Category
  10. Go to System - Index Management and verify the Indexers statuses

BEFORE applying changes provided in the PR, some of the Indexers changed the Status to Require Reindex. Which is not correct as the deleted category was Disabled. And before deleting, full reindex has been done
before_indexer

AFTER switching to the PR, all the indexers are in Status - Ready (green)
after_indexer

Tested with Root and Sub Categories

@engcom-Charlie
Copy link
Contributor Author

@magento run all tests

@magento-engcom-team
Copy link
Contributor

Hi @aleron75, thank you for the review.
ENGCOM-8801 has been created to process this Pull Request

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed

The result is the same as in the report above #32082 (comment)

@m2-assistant
Copy link

m2-assistant bot commented Mar 7, 2021

Hi @engcom-Charlie, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Catalog Component: CatalogSearch Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Type: Feature/Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting disabled category forces category flat and catalog search re-indexed fully
7 participants