Skip to content

Fixed configurable product price indexer issue #26810

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

Conversation

ananth-iyer
Copy link
Member

@ananth-iyer ananth-iyer commented Feb 11, 2020

Description (*)

Configurable products price indexer save min_price in negative number i.e. -0.010000.

Related Pull Requests

Related Issues (if relevant)

  1. Fixes Negative prices in layered navigation #24535
  2. Fixes Magento 2.2.4 Product sorting list by price on category page wrong when configurable product has special price set by mass action. #15609
  3. Fixes Final min_price and max_price calculation on configurable product with special price #14443

Manual testing scenarios (*)

  1. Migrate Magento 1.9.4.2 > Magento 2.3.4
  2. After the migration process - run full re-indexer
  3. Then check the catalog_product_index_price as per the screenshot attached the min_price is incorrect.
    Selection_007

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)

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@m2-assistant
Copy link

m2-assistant bot commented Feb 11, 2020

Hi @ananth-iyer. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@sidolov sidolov added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Aug 17, 2020
@ihor-sviziev ihor-sviziev self-assigned this Sep 18, 2020
@ihor-sviziev
Copy link
Contributor

@magento run all tests

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Sep 18, 2020

Risk: high since the configurable indexation process os affected

The same as for #24962 (comment) that fixes the same issue

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Hi @ananth-iyer,
Seems like your solution breaks some functionality. Could you review failing test results and adjust your solution?

@engcom-Hotel engcom-Hotel self-assigned this Sep 21, 2020
@ihor-sviziev
Copy link
Contributor

@ananth-iyer will you be able to update your PR?

@ananth-iyer
Copy link
Member Author

@ananth-iyer will you be able to update your PR?

Yes, I will sync the PR with magento:2.4-develop branch

@anant-svc anant-svc force-pushed the bugfix/ananth-iyer-configurable-products-price-indexer-fix branch 2 times, most recently from 2dcd6e0 to a87fa22 Compare October 3, 2020 18:59
@ihor-sviziev
Copy link
Contributor

@magento run all tests

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Hi @ananth-iyer,
Unfortunately tests are still failing after your last changes. Could you fix them?

@ghost ghost removed the Progress: review label Oct 5, 2020
@engcom-Hotel
Copy link
Contributor

Sure, will check it soon.

@engcom-Hotel
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE

@engcom-Hotel
Copy link
Contributor

@magento run all tests

@engcom-Hotel
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE

2 similar comments
@engcom-Hotel
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE

@engcom-Hotel
Copy link
Contributor

@magento run Functional Tests B2B, Functional Tests EE

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

✔ Approved!
Finally, tests are passing

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-8481 has been created to process this Pull Request

Copy link
Contributor

@engcom-Delta engcom-Delta left a comment

Choose a reason for hiding this comment

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

@ananth-iyer I tested PR according scenario from related issue that should be fixed by these changes, but issue is still reproducible
Manual testing scenario:

  • Create configurable product with three childs
    image

  • Set Price=10 on configurable product from mass action grid

  • Run cron:run

  • See the price from attributes appeared on product grid
    Screenshot from 2020-12-11 14-18-01

  • See the price from attributes in columns price and final_price in the table catalog_product_index_price
    Screenshot from 2020-12-11 14-17-39

  • Then save configurable product from admin edit page

  • See null value saved for price attribute in catalog_product_entity_decimal
    Screenshot from 2020-12-11 14-19-09

  • Run cron:run

  • Check columns price and final_price in the table catalog_product_index_price

Result:
❌ See 0 saved in columns price and final_price for edited configurable product
Screenshot from 2020-12-11 14-19-41

❌ Still possible to save price and for configurable product in catalog_product_entity_decimal table

Could you take a look?

@ananth-iyer
Copy link
Member Author

@engcom-Delta Set Price=10 on configurable product from mass action grid
x See 0 saved in columns price and final_price for edited configurable product

In Magento 2, as per my knowledge the price field is disabled on configurable product edit pages. So this issue is related to mass action functionality.

This PR is related to indexing issues that take lot of time and price sorting issues on product listing page after migrating from Magento 1.

So I think we have to skip price update if the product type in configurable for the mass action and we need to create a new issue for it.

x Still possible to save price and for configurable product in catalog_product_entity_decimal table
I think this code is copied from Magento 1 as is and causing repetitive issues in Magento 2.

@ihor-sviziev
Copy link
Contributor

@engcom-Delta do we have the listed issues on 2.4-develop branch? If no - that might be a bit different issues

@engcom-Delta
Copy link
Contributor

@ihor-sviziev I was able to reproduce only #24953 on 2.4-develop from listed issues. And I tried this scenario because other issues from Related Issues (if relevant) list I was not able to reproduce

@ananth-iyer Do you have information how to reproduce issue with negative number in min_price without migration magento from 1.9.4.2 to 2.4.x?

@ananth-iyer
Copy link
Member Author

@engcom-Delta Do you have information how to reproduce issue with negative number in min_price without migration magento from 1.9.4.2 to 2.4.x?
No

We should remove the #24953 from this PR because it is related to Mass action page and product mass action functionality needs to get fixed. Indexing issue is fixed in this PR. While submitting this fix I never thought of mass action issue exists or not.

@engcom-Delta engcom-Delta added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jan 12, 2021
@engcom-Hotel
Copy link
Contributor

Hello @ananth-iyer,
The issue which is not covered via your fix has been removed from the description.
Unfortunately, we can't test the migration process from m1 to m2 and we need to perform the test only on m2.
Maybe you have some ideas about how to do it?

@ananth-iyer
Copy link
Member Author

@engcom-Hotel I have migrated the default M1 to M2 and found no issue there. But this issue occurs with the existing M1 project, here the admin adds price in configurable products by mistake.

@ihor-sviziev
Copy link
Contributor

Hi @ananth-iyer,
If you could reproduce this issue without migration from m1 to m2 - please provide steps to reproduce.
Otherwise, we won't fix potential issues caused by the issue during the migration or maybe some old issue in Magento.

If there no steps to reproduce this issue w/o migration - I believe we can't accept such PR. What do you think about it?

@ihor-sviziev
Copy link
Contributor

@ananth-iyer I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for the collaboration!

@m2-assistant
Copy link

m2-assistant bot commented Feb 19, 2021

Hi @ananth-iyer, 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 Award: bug fix Component: Checkout Component: ConfigurableProduct Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Release Line: 2.4 Risk: high Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
7 participants