Fatal error in inventory:reservation:list-inconsistencies
because of wrong sku parameter type
#2904
Labels
inventory:reservation:list-inconsistencies
because of wrong sku parameter type
#2904
Preconditions
magento/inventory-composer-metapackage
v1.1.3magento/module-inventory
v1.0.6Steps to reproduce
inventory_reservation
table, duplicate a row for this product. This will create a reservation inconsistency.inventory:reservation:list-inconsistencies
Expected result
Actual result
What I figured
After some investigation, I was able to conclude that numerical skus like EANs are added as integers in
\Magento\InventoryReservationCli\Model\SalableQuantityInconsistency::addItemQty()
.This is because skus are KEYS of
\Magento\InventoryReservationCli\Model\SalableQuantityInconsistency::$items
array. Php saves numerical string array keys as actual numbers. String type is lost.Suggestion
Before using
\Magento\InventoryReservationCli\Model\SalableQuantityInconsistency::getItems()
's result, and especially keys (skus), cast them as string again.For example in
\Magento\InventoryReservationCli\Model\SalableQuantityInconsistency\FilterManagedStockProducts::execute()
:The text was updated successfully, but these errors were encountered: