Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,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));
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/CatalogInventory/Model/Stock/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public function getModuleByName($moduleName, $modules)
*/
public function getFrontNameByRoute($routeName)
{
return $this->_routes[$routeName] ?? false;
return $this->_routes[(string) $routeName] ?? false;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions app/code/core/Mage/Index/Model/Indexer/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions lib/Varien/Data/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 0 additions & 1 deletion lib/Varien/Http/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ public function read()
*/
public function close()
{
curl_close($this->_getResource());
$this->_resource = null;
return $this;
}
Expand Down
Loading