From 7804594e6275a948320c71dd46380c9c98a9c6b9 Mon Sep 17 00:00:00 2001 From: Colin Mollenhour Date: Mon, 10 Oct 2016 11:25:34 -0400 Subject: [PATCH 1/2] Fix regression from PR #103. Forgot to use array access by reference... --- app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php index 3a47f78f935..f1f3e447a09 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php @@ -145,7 +145,7 @@ public function getProductsStock($stock, $productIds, $lockRows = false) ->from($productTable, ['entity_id', 'type_id']) ->where('entity_id IN(?)', $productIds); $typeIds = $this->_getWriteAdapter()->fetchPairs($select); - foreach ($rows as $row) { + foreach ($rows as &$row) { $row['type_id'] = $typeIds[$row['product_id']]; } return $rows; From 6244f7b2d9a8f42a2213776503cf9fc76a9b43d1 Mon Sep 17 00:00:00 2001 From: Alex Kirsch Date: Mon, 10 Oct 2016 16:13:16 -0400 Subject: [PATCH 2/2] Use older array syntax --- app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php index f1f3e447a09..83acc130dd0 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php @@ -142,7 +142,7 @@ public function getProductsStock($stock, $productIds, $lockRows = false) // so using a separate query here significantly reduces the number of // unnecessarily locked rows in other tables, thereby avoiding deadlocks. $select = $this->_getWriteAdapter()->select() - ->from($productTable, ['entity_id', 'type_id']) + ->from($productTable, array('entity_id', 'type_id')) ->where('entity_id IN(?)', $productIds); $typeIds = $this->_getWriteAdapter()->fetchPairs($select); foreach ($rows as &$row) {