QUALITY PATCH

MDVA-41061-V2: Stock status resets to salable when a product is saved from Admin

Stock status resets to salable when a product is saved from Admin. Quality patch MDVA-41061-V2 for magento/module-catalog-inventory applies to Magento Open Source and Adobe Commerce 2.4.2 to 2.4.3-p3.

Categories
Inventory
Components
magento/module-catalog-inventory, magento/module-inventory-catalog, magento/module-inventory-configurable-product, magento/module-inventory-configuration, magento/module-inventory-indexer, magento/module-inventory-sales
Origin
adobe-commerce-support

No Adobe documentation page exists for this patch.

Install

Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply MDVA-41061-V2. On Cloud, add MDVA-41061-V2 under stage.build.QUALITY_PATCHES in .magento.env.yaml.

For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its MDVA-41061-V2/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.

Patch files and compatible versions

Packages across compatible versions (6): magento/module-catalog-inventory, magento/module-inventory-catalog, magento/module-inventory-configurable-product, magento/module-inventory-configuration, magento/module-inventory-indexer, magento/module-inventory-sales
Packages across compatible versions (6): magento/module-catalog-inventory, magento/module-inventory-catalog, magento/module-inventory-configurable-product, magento/module-inventory-configuration, magento/module-inventory-indexer, magento/module-inventory-sales

magento/magento2-base >=2.4.2 <2.4.3

Magento Open Source
2.4.2-p2, 2.4.2-p1, 2.4.2
Adobe Commerce
2.4.2-p2, 2.4.2-p1, 2.4.2
Replaced with
MDVA-41061-V3
Patch file
patches/os/MDVA-41061_2.4.2-p1_v3.patch
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/GetStatusExpression.php (added)
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/StatusExpression/DefaultExpression.php (added)
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/StatusExpression/ExpressionInterface.php (added)
  • vendor/magento/module-catalog-inventory/etc/di.xml

magento/magento2-base >=2.4.3 <2.4.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3
Replaced with
MDVA-41061-V3
Patch file
patches/os/MDVA-41015_2.4.3.patch
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/DefaultStock.php
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/GetStatusExpression.php (added)
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/StatusExpression/DefaultExpression.php (added)
  • vendor/magento/module-catalog-inventory/Model/ResourceModel/Indexer/Stock/StatusExpression/ExpressionInterface.php (added)
  • vendor/magento/module-catalog-inventory/etc/di.xml

magento/inventory-metapackage 1.2.2

Magento Open Source
2.4.2-p2, 2.4.2-p1, 2.4.2
Adobe Commerce
2.4.2-p2, 2.4.2-p1, 2.4.2
Replaced with
MDVA-41061-V3
Patch file
patches/os/MDVA-41061_1.2.2_v3.patch
  • vendor/magento/module-inventory-catalog/Model/BulkInventoryTransfer.php
  • vendor/magento/module-inventory-catalog/Model/ResourceModel/StockStatusExpressionForDefaultStock.php (added)
  • vendor/magento/module-inventory-catalog/Model/SourceItemsSaveSynchronization/SetDataToLegacyCatalogInventory.php
  • vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/Api/StockRegistry/AdaptUpdateStockStatusBySkuPlugin.php (added)
  • vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/Api/StockRegistry/SetQtyToLegacyStock.php (added)
  • vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/UpdateSourceItemAtLegacyStockItemSavePlugin.php
  • vendor/magento/module-inventory-catalog/etc/di.xml
  • vendor/magento/module-inventory-configurable-product/Plugin/CatalogInventory/Api/StockRegistry/SetQtyToLegacyStock.php (added)
  • vendor/magento/module-inventory-configurable-product/Plugin/CatalogInventory/Observer/ParentItemProcessor/AdaptParentItemProcessorPlugin.php
  • vendor/magento/module-inventory-configurable-product/etc/di.xml
  • vendor/magento/module-inventory-configuration/Model/LegacyStockItem/CacheStorage.php (added)
  • vendor/magento/module-inventory-configuration/Plugin/InventoryConfiguration/Model/GetLegacyStockItemCache.php
  • vendor/magento/module-inventory-indexer/Indexer/SelectBuilder.php
  • vendor/magento/module-inventory-indexer/Indexer/SourceItem/Strategy/Sync.php
  • vendor/magento/module-inventory-indexer/Indexer/Stock/PrepareReservationsIndexData.php (added)
  • vendor/magento/module-inventory-indexer/Indexer/Stock/ReservationsIndexTable.php (added)
  • vendor/magento/module-inventory-indexer/Indexer/Stock/Strategy/Sync.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/BackordersCondition.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/IsStockItemSalableConditionChain.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/MinQtyStockCondition.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/MinQtyStockWithReservationsCondition.php (added)
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/ReservationsCondition.php (added)
  • vendor/magento/module-inventory-sales/etc/di.xml

magento/inventory-metapackage >=1.2.3 <1.2.4

Magento Open Source
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3
Adobe Commerce
2.4.3-p3, 2.4.3-p2, 2.4.3-p1, 2.4.3
Replaced with
MDVA-41061-V3
Patch file
patches/os/MDVA-41015_1.2.3.patch
  • vendor/magento/module-inventory-catalog/Model/BulkInventoryTransfer.php
  • vendor/magento/module-inventory-catalog/Model/ResourceModel/StockStatusExpressionForDefaultStock.php (added)
  • vendor/magento/module-inventory-catalog/Model/SourceItemsSaveSynchronization/SetDataToLegacyCatalogInventory.php
  • vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/Api/StockRegistry/AdaptUpdateStockStatusBySkuPlugin.php (added)
  • vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/Api/StockRegistry/SetQtyToLegacyStock.php (added)
  • vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/UpdateSourceItemAtLegacyStockItemSavePlugin.php
  • vendor/magento/module-inventory-catalog/etc/di.xml
  • vendor/magento/module-inventory-configurable-product/Plugin/CatalogInventory/Api/StockRegistry/SetQtyToLegacyStock.php (added)
  • vendor/magento/module-inventory-configurable-product/Plugin/CatalogInventory/Observer/ParentItemProcessor/AdaptParentItemProcessorPlugin.php
  • vendor/magento/module-inventory-configurable-product/etc/di.xml
  • vendor/magento/module-inventory-configuration/Model/LegacyStockItem/CacheStorage.php (added)
  • vendor/magento/module-inventory-configuration/Plugin/InventoryConfiguration/Model/GetLegacyStockItemCache.php
  • vendor/magento/module-inventory-indexer/Indexer/SelectBuilder.php
  • vendor/magento/module-inventory-indexer/Indexer/SourceItem/Strategy/Sync.php
  • vendor/magento/module-inventory-indexer/Indexer/Stock/PrepareReservationsIndexData.php (added)
  • vendor/magento/module-inventory-indexer/Indexer/Stock/ReservationsIndexTable.php (added)
  • vendor/magento/module-inventory-indexer/Indexer/Stock/Strategy/Sync.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/IsStockItemSalableConditionChain.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/MinQtyStockCondition.php
  • vendor/magento/module-inventory-sales/Model/ResourceModel/IsStockItemSalableCondition/ReservationsCondition.php (added)
  • vendor/magento/module-inventory-sales/etc/di.xml

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.