Skip to content

Commit 22c15d7

Browse files
S0FTWEXsreichelkiatng
authored
Fixed undefined array key "values" in Mage_Catalog_Model_Product_Attribute_Backend_Media (#4125)
* Removed 'includes' folder Removed unnecessary 'includes' folder, because Compiler was removed lately * Fixed PHP8 ArgumentCountError with Mage_ConfigurableSwatches enabled. * Revert "Removed 'includes' folder" This reverts commit 18ff2d6. * Fixed undefined array key "values" in Backend Media 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 * Added check for isModuleOutputEnabled('Mage_AdminNotification') * Revert "Added check for isModuleOutputEnabled('Mage_AdminNotification')" This reverts commit 8685a12. --------- Co-authored-by: Sven Reichel <[email protected]> Co-authored-by: Ng Kiat Siong <[email protected]>
1 parent ee26c87 commit 22c15d7

File tree

1 file changed

+4
-0
lines changed
  • app/code/core/Mage/Catalog/Model/Product/Attribute/Backend

1 file changed

+4
-0
lines changed

app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php

+4
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ public function beforeSave($object)
110110
$value['images'] = Mage::helper('core')->jsonDecode($value['images']);
111111
}
112112

113+
if (!isset($value['values'])) {
114+
$value['values'] = [];
115+
}
116+
113117
if (!is_array($value['values']) && strlen($value['values']) > 0) {
114118
$value['values'] = Mage::helper('core')->jsonDecode($value['values']);
115119
}

0 commit comments

Comments
 (0)