Skip to content

Commit 14f61cd

Browse files
Remove strict typing for Mage_Catalog_Model_Product->setStockItem method and fix incorrect class instantiated in addStockStatusToProducts. Refs OpenMage#2066
1 parent 90fb732 commit 14f61cd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/core/Mage/Catalog/Model/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ public function hasStockItem()
713713
}
714714

715715
/**
716-
* @param Mage_CatalogInventory_Model_Stock_Item $stockItem
716+
* @param Varien_Object|Mage_CatalogInventory_Model_Stock_Item $stockItem
717717
* @return $this
718718
*/
719-
public function setStockItem(Mage_CatalogInventory_Model_Stock_Item $stockItem)
719+
public function setStockItem($stockItem)
720720
{
721721
$this->_stockItem = $stockItem;
722722
return $this;

app/code/core/Mage/CatalogInventory/Model/Stock/Status.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public function addStockStatusToProducts($productCollection, $websiteId = null,
493493

494494
/* back compatible stock item */
495495
foreach ($productCollection as $product) {
496-
$object = new Varien_Object(array('is_in_stock' => $product->getData('is_salable')));
496+
$object = Mage::getModel('cataloginventory/stock_item', ['is_in_stock' => $product->getData('is_salable')]);
497497
$product->setStockItem($object);
498498
}
499499

0 commit comments

Comments
 (0)