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

Do not change inventoryInStock and inventoryAvailableToSell from null to 0 #4932

Closed
3 tasks done
aldeed opened this issue Jan 23, 2019 · 0 comments
Closed
3 tasks done
Assignees

Comments

@aldeed
Copy link
Contributor

aldeed commented Jan 23, 2019

Prerequisites

  • Are you running the latest version?
  • Are you able to consistently reproduce the issue?
  • Did you search the issue queue for existing issue? Search issues

Issue Description

In https://github.com/reactioncommerce/reaction/blob/develop/imports/plugins/core/catalog/server/no-meteor/utils/createCatalogProduct.js#L30-L31 we have || 0 for inventoryInStock and inventoryAvailableToSell everywhere. This would convert null to 0, but these might be null if we are not tracking inventory, and converting to 0 would change the meaning. null means not tracked while 0 means tracked and unavailable.

Possible Solution

Remove || 0 for inventoryInStock and inventoryAvailableToSell everywhere in that file. This is a simple task, but we will need to test carefully that this does not break anything in the storefront that might be expecting always to get a number and not properly handling null value.

Versions

2.0.0 RC9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant