diff --git a/app/code/core/Mage/Catalog/Model/Product/Type.php b/app/code/core/Mage/Catalog/Model/Product/Type.php index e575daaf205..e58889f3d75 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type.php @@ -51,7 +51,7 @@ class Mage_Catalog_Model_Product_Type public static function factory($product, $singleton = false) { $types = self::getTypes(); - $typeId = $product->getTypeId(); + $typeId = (string) $product->getTypeId(); if (!empty($types[$typeId]['model'])) { $typeModelName = $types[$typeId]['model']; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php index 9c273473ea5..b7e1a1cc5cd 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php @@ -309,6 +309,10 @@ public function reindexProductIds($ids) */ protected function _getIndexer($productTypeId) { + if ($productTypeId === null) { + $productTypeId = ''; + } + $types = $this->getTypeIndexers(); if (!isset($types[$productTypeId])) { Mage::throwException(Mage::helper('catalog')->__('Unsupported product type "%s".', $productTypeId)); diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php index 6f1652b53a4..011d66d853d 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php @@ -183,7 +183,7 @@ public function assignProduct(Mage_Catalog_Model_Product $product, $stockId = 1, if (is_null($stockStatus)) { $websiteId = $product->getStore()->getWebsiteId(); $status = $this->getProductStatus($product->getId(), $websiteId, $stockId); - $stockStatus = $status[$product->getId()] ?? null; + $stockStatus = $status[(string) $product->getId()] ?? null; } $product->setIsSalable($stockStatus); diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php index c22e97a0d51..aeb3ebeea31 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php @@ -406,7 +406,7 @@ public function getModuleByName($moduleName, $modules) */ public function getFrontNameByRoute($routeName) { - return $this->_routes[$routeName] ?? false; + return $this->_routes[(string) $routeName] ?? false; } /** diff --git a/app/code/core/Mage/Index/Model/Indexer/Abstract.php b/app/code/core/Mage/Index/Model/Indexer/Abstract.php index 28c22cc78ce..62c1cfbc0ff 100644 --- a/app/code/core/Mage/Index/Model/Indexer/Abstract.php +++ b/app/code/core/Mage/Index/Model/Indexer/Abstract.php @@ -110,6 +110,10 @@ public function matchEvent(Mage_Index_Model_Event $event) */ public function matchEntityAndType($entity, $type) { + if ($entity === null) { + $entity = ''; + } + if (isset($this->_matchedEntities[$entity])) { if (in_array($type, $this->_matchedEntities[$entity])) { return true; diff --git a/lib/Varien/Data/Collection.php b/lib/Varien/Data/Collection.php index 525a18a44c5..518587dba79 100644 --- a/lib/Varien/Data/Collection.php +++ b/lib/Varien/Data/Collection.php @@ -738,6 +738,11 @@ protected function _toOptionHash($valueField = 'id', $labelField = 'name') public function getItemById($idValue) { $this->load(); + + if ($idValue === null) { + $idValue = ''; + } + return $this->_items[$idValue] ?? null; } diff --git a/lib/Varien/Http/Adapter/Curl.php b/lib/Varien/Http/Adapter/Curl.php index f3fac843fca..a27bac779c0 100644 --- a/lib/Varien/Http/Adapter/Curl.php +++ b/lib/Varien/Http/Adapter/Curl.php @@ -216,7 +216,6 @@ public function read() */ public function close() { - curl_close($this->_getResource()); $this->_resource = null; return $this; }