Skip to content

catalog_product_price is not populated with products when back in stock #37795

Open
@sebfie

Description

@sebfie

Preconditions and environment

  • 2.4.6-p1
  • With sample data

Steps to reproduce

  1. Create a Magento 2.4.6-p1 instance
  2. Install sample data
  3. Check core_config_data cataloginventory/options/show_out_of_stock is set to 0 (default value)
  4. Take a product without related/crosssell/upsell products (no catalog_product_link). !!!! IMPORTANT !!!! because this products will trigger an insert in catalog_product_price_cl
  5. Set indexer as scheduled bin/magento indexer:set-mode schedule
  6. Set product from Adminhtml as out_of_stock with a stock of 0 and save => the product is not removed from catalog_product_index_price and catalog_product_price_cl is not populated
  7. Run n98-magerun2 sys:cron:run indexer_update_all_views => catalog_product_index_price are not removed for this product
  8. Remove lines from catalog_product_index_price for this product
  9. Set product with in_stock and a stock of 8 then save it => catalog_product_price_cl is not populated so partial reindex will not fill catalog_product_index_price table
  10. Run n98-magerun2 sys:cron:run indexer_update_all_views => catalog_product_index_price is not filled by this product

Expected result

We expect to fill/remove from catalog_product_index_price when a product switch from out_of_stock and in_stock. The main issue is that there is not trigger to insert the concerning product in catalog_product_price_cl when the cataloginventory_stock_item change

Actual result

Product data are missing/disappear from catalog_product_index_price

Additional information

The issue comes from this commit :

b396993

Triggers are not well created on cataloginventory_stock_item to fill the table catalog_product_price_cl when stock change.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: ProductComponent: CronIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.6-p1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions