Skip to content

Commit

Permalink
Merge pull request #123 from magento-folks/github_pr
Browse files Browse the repository at this point in the history
[Folks] GitHub requests
  • Loading branch information
Volodymyr Klymenko authored Jul 4, 2016
2 parents 53e270e + 7aeac1e commit c29f3e7
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Magento\Framework\Registry;
use Magento\Payment\Model\IframeConfigProvider;
use Magento\Quote\Api\CartManagementInterface;
use Magento\Framework\Exception\LocalizedException;

/**
* Class Place
Expand Down Expand Up @@ -125,6 +126,9 @@ protected function placeCheckoutOrder()
'action' => $this
]
);
} catch (LocalizedException $exception) {
$result->setData('error', true);
$result->setData('error_messages', $exception->getMessage());
} catch (\Exception $exception) {
$result->setData('error', true);
$result->setData('error_messages', __('Unable to place order. Please try again later.'));
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Checkout/Block/Cart/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getHref()
*/
protected function _toHtml()
{
if ($this->_moduleManager->isOutputEnabled('Magento_Checkout')) {
if (!$this->_moduleManager->isOutputEnabled('Magento_Checkout')) {
return '';
}
return parent::_toHtml();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testToHtml()
)->with(
'Magento_Checkout'
)->will(
$this->returnValue(true)
$this->returnValue(false)
);
$this->assertSame('', $block->toHtml());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ define(
emailValidationResult = customer.isLoggedIn();

if (!quote.shippingMethod()) {
this.errorValidationMessage('Please specify a shipping method.');
this.errorValidationMessage($.mage.__('Please specify a shipping method.'));

return false;
}
Expand Down
6 changes: 5 additions & 1 deletion app/code/Magento/Eav/Model/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,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
Original file line number Diff line number Diff line change
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
1 change: 1 addition & 0 deletions app/code/Magento/Eav/Model/Entity/Setup/PropertyMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class PropertyMapper extends PropertyMapperAbstract
public function map(array $input, $entityTypeId)
{
return [
'attribute_model' => $this->_getValue($input, 'attribute_model'),
'backend_model' => $this->_getValue($input, 'backend'),
'backend_type' => $this->_getValue($input, 'type', 'varchar'),
'backend_table' => $this->_getValue($input, 'table'),
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Eav/Model/ResourceModel/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ public function getLoadAttributesSelectGroups($selects)
foreach ($selects as $selectGroup) {
$mainGroup = array_merge($mainGroup, $selectGroup);
}
return [$mainGroup];
return $mainGroup;
}
}

0 comments on commit c29f3e7

Please sign in to comment.