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

Remove erronious check #3352

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove erronious check
The isUseConfigManageStock variable only describes whether or not the stockItemConfiguration uses the default config value or the stockItemConfiguration specific config value for this the isManageStock value. It does not say anything about the value of the manage_stock setting. Since this logic is already correctly implemented in the getManageStock function this line can be completely removed.

As it was the line causes a bug where every PUT call to /products/{sku}/stockItems/{stock_item} endpoint with a use_config_manage_stock value of false will always cause that stockItem to register as in_stock until a reindex is run.

As it is right now this call will still set products in_stock when Manage stock is disabled. I don't know enough about that workflow to determine if that is the correct behavior.
  • Loading branch information
RikvdHeijden authored Jul 4, 2022
commit 12bc1295df6aec1fd0b77dd0bf175fbcd6b68b8c
Original file line number Diff line number Diff line change
@@ -85,9 +85,7 @@ public function afterUpdateStockItemBySku(
$productType = $this->getProductTypesBySkus->execute([$productSku])[$productSku];

$stockItemConfiguration = $this->getStockItemConfiguration->execute($productSku, Stock::DEFAULT_STOCK_ID);
if ($stockItemConfiguration->isManageStock() === false
|| $stockItemConfiguration->isUseConfigManageStock() === false
) {
if ($stockItemConfiguration->isManageStock() === false) {
$this->setDataToLegacyStockStatus->execute($productSku, (float)$stockItem->getQty(), 1);
} else {
if ($this->isSourceItemManagementAllowedForProductType->execute($productType)