Repository navigation
Conversation
…ducts from the price index
getAffectedProducts() returns one row per combination with attribute conditions, and products affected before and after an update were indexed twice. A new rule was never indexed since no product list is collected before its creation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1364 (only the last commit belongs to this PR).
On the catalog price rules page (the legacy one, used unless the
catalog_price_rulefeature flag is enabled),actionAdminSpecificPriceRuleControllerSaveAfterreindexed every row ofgetAffectedProducts(), before and after the save:getAffectedProducts()returns one row per matching combination, so a product was indexed once per combination,actionObjectSpecificPriceRuleUpdateBefore, which doesn't fire on creation, and the hook returned early without it.Each affected product is now indexed once, on creation too. A rule without conditions returns
id_product0, which is skipped as before: it affects the whole catalog and still needs a price index rebuild.The Symfony page (
catalog_price_rulefeature flag on), rule deletion and rules affecting the whole catalog are handled in a follow-up.On the bench rule of #1374 (category + color conditions, 120 products, 128 rows), an update ran
indexProductPrices()256 times, now 120.How to test
tests/php/FacetedSearch/Hook/SpecificPriceTest.phppasses.