Skip to content
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

fix(inventory-catalog): don't join disabled products into collection #3401

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

damienwebdev
Copy link
Member

@damienwebdev damienwebdev commented Oct 19, 2023

Description (*)

MSI mistakenly conflates two situations as the same as a result of complex indexing behaviors.

  1. When a product is disabled, it has no entry in the cataloginventory_stock_index or inventory_stock_*
  2. When a product is not assigned to any sources, it has no entry in the cataloginventory_stock_index or inventory_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

The commit e8d2ca7 attempts to allow products on category pages when the stock has no sources.

The second 17cf342 attempts to allow computing the lowest price of a configurable using only in stock products.

I'm specifically reverting part of 17cf342 but e8d2ca7 is also mistaken.

Likely, both of these commits need to be reverted and reworked to disambiguate "not in the stock index" from:

  1. When a product is disabled
  2. When a product is not assigned to any sources

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)

@paresh6002
Copy link

@magento run all tests

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Pull Request Progress
  
Ready for Review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants