Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/code/core/Mage/Eav/Model/Entity/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,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);
Expand Down
7 changes: 6 additions & 1 deletion app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,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);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getLoadAttributesSelectGroups($selects)
foreach ($selects as $eavType => $selectGroup) {
$mainGroup = array_merge($mainGroup, $selectGroup);
}
return [$mainGroup];
return $mainGroup;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a strong behavior change

}

/**
Expand Down