diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 7b7b76e4479..5a35eebdab7 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -979,7 +979,12 @@ protected function _loadModelAttributes($object) $selectGroups = $helper->getLoadAttributesSelectGroups($selects); foreach ($selectGroups as $selects) { if (!empty($selects)) { - $select = $this->_prepareLoadSelect($selects); + if (is_array($selects)) { + $select = $this->_prepareLoadSelect($selects); + } else { + $select = $selects; + } + $values = $this->_getReadAdapter()->fetchAll($select); foreach ($values as $valueRow) { $this->_setAttributeValue($object, $valueRow); diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index 4c361808ac1..bcd055b7d4f 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -1120,7 +1120,12 @@ public function _loadAttributes($printQuery = false, $logQuery = false) foreach ($selectGroups as $selects) { if (!empty($selects)) { try { - $select = implode(' UNION ALL ', $selects); + if (is_array($selects)) { + $select = implode(' UNION ALL ', $selects); + } else { + $select = $selects; + } + $values = $this->getConnection()->fetchAll($select); } catch (Exception $e) { Mage::printException($e, $select); diff --git a/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php index 3321bd11925..2dc4eaf2533 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php @@ -108,7 +108,7 @@ public function getLoadAttributesSelectGroups($selects) foreach ($selects as $eavType => $selectGroup) { $mainGroup = array_merge($mainGroup, $selectGroup); } - return [$mainGroup]; + return $mainGroup; } /**