Skip to content

Commit

Permalink
Fixed getAttributeRawValue return false if value is '0' (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastienlm committed Jan 12, 2023
1 parent e50f97a commit bbe69a4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/code/core/Mage/Catalog/Model/Resource/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ protected function _prepareValueForSave($value, Mage_Eav_Model_Entity_Attribute_
* @param int $entityId
* @param int|string|array $attribute atrribute's ids or codes
* @param int|Mage_Core_Model_Store $store
* @return bool|string|array
* @return bool|string|null|array
*/
public function getAttributeRawValue($entityId, $attribute, $store)
{
Expand Down Expand Up @@ -687,8 +687,7 @@ public function getAttributeRawValue($entityId, $attribute, $store)
}

if (count($attributesData) === 1 && !$returnArray) {
$_data = reset($attributesData);
$attributesData = $_data;
return reset($attributesData);
}

return $attributesData ? $attributesData : false;
Expand Down

0 comments on commit bbe69a4

Please sign in to comment.