Skip to content

Commit a04c1b2

Browse files
authored
Fix array_key_exists on objects (deprecated notice or fatal error) (#1276)
1 parent 57563fc commit a04c1b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ public function getDefaultProductValue($fieldName, $productType)
552552
{
553553
$fieldData = $this->getFieldset($fieldName) ? (array) $this->getFieldset($fieldName) : null;
554554
if (
555-
count($fieldData)
556-
&& array_key_exists($productType, $fieldData['product_type'])
555+
!empty($fieldData)
556+
&& ((is_array($fieldData['product_type']) && array_key_exists($productType, $fieldData['product_type'])) || (is_object($fieldData['product_type']) && property_exists($fieldData['product_type'], $productType)))
557557
&& (bool)$fieldData['use_config']
558558
) {
559559
return $fieldData['inventory'];

0 commit comments

Comments
 (0)