magento2: catalog_product_price is not populated with products when back in stock
Preconditions and environment
- 2.4.6-p1
- With sample data
Steps to reproduce
- Create a Magento 2.4.6-p1 instance
- Install sample data
- Check core_config_data
cataloginventory/options/show_out_of_stockis set to 0 (default value) - 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 - Set indexer as scheduled
bin/magento indexer:set-mode schedule - 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
- Run
n98-magerun2 sys:cron:run indexer_update_all_views=>catalog_product_index_priceare not removed for this product - Remove lines from
catalog_product_index_pricefor this product - Set product with
in_stockand a stock of 8 then save it => catalog_product_price_cl is not populated so partial reindex will not fillcatalog_product_index_pricetable - Run
n98-magerun2 sys:cron:run indexer_update_all_views=>catalog_product_index_priceis 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 :
https://github.com/magento/magento2/commit/b3969936251e1a03427cd24c209abb6af3a0ce1b
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”.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 3
- Comments: 17 (4 by maintainers)
Hi @sebfie,
Thanks for your update.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.The issue is reproducible with partial reindexing,
Here product id is 2 not disappearing after doing Partial Reindexing.
Hence Confirming the issue.
Thanks.
Thx a lot. I refered the commit I think responsible of that. Take a look :
https://github.com/magento/magento2/commit/b3969936251e1a03427cd24c209abb6af3a0ce1b