Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #3704 regarding integer attribute values being cast to decimal #3705

Merged
merged 3 commits into from Jul 6, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/code/Magento/Eav/Model/Entity/AbstractEntity.php
Expand Up @@ -1064,7 +1064,11 @@ protected function _loadModelAttributes($object)
$selectGroups = $this->_resourceHelper->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->getConnection()->fetchAll($select);
foreach ($values as $valueRow) {
$this->_setAttributeValue($object, $valueRow);
Expand Down
Expand Up @@ -1175,7 +1175,11 @@ 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) {
$this->printLogQuery(true, true, $select);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Eav/Model/ResourceModel/Helper.php
Expand Up @@ -80,6 +80,6 @@ public function getLoadAttributesSelectGroups($selects)
foreach ($selects as $selectGroup) {
$mainGroup = array_merge($mainGroup, $selectGroup);
}
return [$mainGroup];
return $mainGroup;
}
}