Skip to content

Commit 51978cf

Browse files
authored
1 parent f7a99b4 commit 51978cf

File tree

7 files changed

+16
-4
lines changed

7 files changed

+16
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Mage_Catalog_Model_Product_Type
5151
public static function factory($product, $singleton = false)
5252
{
5353
$types = self::getTypes();
54-
$typeId = $product->getTypeId();
54+
$typeId = (string) $product->getTypeId();
5555

5656
if (!empty($types[$typeId]['model'])) {
5757
$typeModelName = $types[$typeId]['model'];

app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ public function reindexProductIds($ids)
309309
*/
310310
protected function _getIndexer($productTypeId)
311311
{
312+
if ($productTypeId === null) {
313+
$productTypeId = '';
314+
}
315+
312316
$types = $this->getTypeIndexers();
313317
if (!isset($types[$productTypeId])) {
314318
Mage::throwException(Mage::helper('catalog')->__('Unsupported product type "%s".', $productTypeId));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function assignProduct(Mage_Catalog_Model_Product $product, $stockId = 1,
182182
if (is_null($stockStatus)) {
183183
$websiteId = $product->getStore()->getWebsiteId();
184184
$status = $this->getProductStatus($product->getId(), $websiteId, $stockId);
185-
$stockStatus = $status[$product->getId()] ?? null;
185+
$stockStatus = $status[(string) $product->getId()] ?? null;
186186
}
187187

188188
$product->setIsSalable($stockStatus);

app/code/core/Mage/Core/Controller/Varien/Router/Standard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public function getModuleByName($moduleName, $modules)
406406
*/
407407
public function getFrontNameByRoute($routeName)
408408
{
409-
return $this->_routes[$routeName] ?? false;
409+
return $this->_routes[(string) $routeName] ?? false;
410410
}
411411

412412
/**

app/code/core/Mage/Index/Model/Indexer/Abstract.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ public function matchEvent(Mage_Index_Model_Event $event)
110110
*/
111111
public function matchEntityAndType($entity, $type)
112112
{
113+
if ($entity === null) {
114+
$entity = '';
115+
}
116+
113117
if (isset($this->_matchedEntities[$entity])) {
114118
if (in_array($type, $this->_matchedEntities[$entity])) {
115119
return true;

lib/Varien/Data/Collection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,11 @@ protected function _toOptionHash($valueField = 'id', $labelField = 'name')
739739
public function getItemById($idValue)
740740
{
741741
$this->load();
742+
743+
if ($idValue === null) {
744+
$idValue = '';
745+
}
746+
742747
return $this->_items[$idValue] ?? null;
743748
}
744749

lib/Varien/Http/Adapter/Curl.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ public function read()
216216
*/
217217
public function close()
218218
{
219-
curl_close($this->_getResource());
220219
$this->_resource = null;
221220
return $this;
222221
}

0 commit comments

Comments
 (0)