Skip to content

Commit 827f81f

Browse files
midlancolinmollenhour
authored andcommitted
Fixed unexpectable behavior of getAttributeRawValue(), issue #658 (#664)
* Fixed unexpectable behavior of getAttributeRawValue(), issue #658 * Keep backcompatibility #658
1 parent d01a916 commit 827f81f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/code/core/Mage/Catalog/Model/Resource/Abstract.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,15 @@ public function getAttributeRawValue($entityId, $attribute, $store)
585585
if (!$entityId || empty($attribute)) {
586586
return false;
587587
}
588+
589+
$returnArray = false;
590+
588591
if (!is_array($attribute)) {
589592
$attribute = array($attribute);
590593
}
594+
elseif (sizeof($attribute) > 1) {
595+
$returnArray = true;
596+
}
591597

592598
$attributesData = array();
593599
$staticAttributes = array();
@@ -676,7 +682,7 @@ public function getAttributeRawValue($entityId, $attribute, $store)
676682
}
677683
}
678684

679-
if (sizeof($attributesData) == 1) {
685+
if (sizeof($attributesData) == 1 && !$returnArray) {
680686
$_data = each($attributesData);
681687
$attributesData = $_data[1];
682688
}

0 commit comments

Comments
 (0)