inventory
inventory copied to clipboard
fix(inventory-catalog): don't join disabled products into collection
Description (*)
MSI mistakenly conflates two situations as the same as a result of complex indexing behaviors.
- When a product is disabled, it has no entry in the
cataloginventory_stock_indexorinventory_stock_* - When a product is not assigned to any sources, it has no entry in the
cataloginventory_stock_indexorinventory_stock_*
Fixed Issues (if relevant)
Currently, when computing the children of composite products like Bundles, Groups and Configurables, MSI will accidentally join in disabled children resulting in records with is_salable = NULL when adding stock data to a product collection.
This commit restores the original behavior.
This problem comes from @bubasuma in two separate commits
- https://github.com/magento/inventory/commit/e8d2ca76fc43101afd734d3f58357f1918cf1971
- https://github.com/magento/inventory/commit/17cf3428a3e0de1237530305be4986b89fb83b70
The commit https://github.com/magento/inventory/commit/e8d2ca76fc43101afd734d3f58357f1918cf1971 attempts to allow products on category pages when the stock has no sources.
The second https://github.com/magento/inventory/commit/17cf3428a3e0de1237530305be4986b89fb83b70 attempts to allow computing the lowest price of a configurable using only in stock products.
I'm specifically reverting part of https://github.com/magento/inventory/commit/17cf3428a3e0de1237530305be4986b89fb83b70 but https://github.com/magento/inventory/commit/e8d2ca76fc43101afd734d3f58357f1918cf1971 is also mistaken.
Likely, both of these commits need to be reverted and reworked to disambiguate "not in the stock index" from:
- When a product is disabled
- When a product is not assigned to any sources
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All new or changed code is covered with unit/integration tests (if applicable)
- [ ] All automated tests passed successfully (all builds are green)
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.