Skip to content

Commit

Permalink
Fixed undefined array key "values" in Backend Media
Browse files Browse the repository at this point in the history
fix undefined array key "values"  in /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 113
and
fixed  foreach() argument must be of type array|object, null given  in /app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php on line 167
  • Loading branch information
S0FTWEX committed Jul 28, 2024
1 parent d6a7496 commit d0a74b8
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public function beforeSave($object)
$value['images'] = Mage::helper('core')->jsonDecode($value['images']);
}

if (!isset($value['values'])) {
$value['values'] = [];
}

if (!is_array($value['values']) && strlen($value['values']) > 0) {
$value['values'] = Mage::helper('core')->jsonDecode($value['values']);
}
Expand Down

0 comments on commit d0a74b8

Please sign in to comment.