Skip to content

Commit c7a56e9

Browse files
committed
Merge remote-tracking branch 'origin/2.1-develop' into MAGETWO-67681
2 parents ab9237c + 86c9cad commit c7a56e9

File tree

39 files changed

+811
-365
lines changed

39 files changed

+811
-365
lines changed

app/code/Magento/Authorizenet/view/frontend/web/js/view/payment/method-renderer/authorizenet-directpost.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
define(
66
[
77
'jquery',
8-
'Magento_Payment/js/view/payment/iframe'
8+
'Magento_Payment/js/view/payment/iframe',
9+
'mage/translate'
910
],
10-
function ($, Component) {
11+
function ($, Component, $t) {
1112
'use strict';
1213

1314
return Component.extend({
1415
defaults: {
1516
template: 'Magento_Authorizenet/payment/authorizenet-directpost',
16-
timeoutMessage: 'Sorry, but something went wrong. Please contact the seller.'
17+
timeoutMessage: $t('Sorry, but something went wrong. Please contact the seller.')
1718
},
1819
placeOrderHandler: null,
1920
validateHandler: null,

app/code/Magento/Backup/Model/BackupFactory.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,16 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan
3535
*/
3636
public function create($timestamp, $type)
3737
{
38-
$backupId = $timestamp . '_' . $type;
3938
$fsCollection = $this->_objectManager->get('Magento\Backup\Model\Fs\Collection');
4039
$backupInstance = $this->_objectManager->get('Magento\Backup\Model\Backup');
40+
4141
foreach ($fsCollection as $backup) {
42-
if ($backup->getId() == $backupId) {
43-
$backupInstance->setType(
44-
$backup->getType()
45-
)->setTime(
46-
$backup->getTime()
47-
)->setName(
48-
$backup->getName()
49-
)->setPath(
50-
$backup->getPath()
51-
);
42+
if ($backup->getTime() === (int) $timestamp && $backup->getType() === $type) {
43+
$backupInstance->setData(['id' => $backup->getId()])
44+
->setType($backup->getType())
45+
->setTime($backup->getTime())
46+
->setName($backup->getName())
47+
->setPath($backup->getPath());
5248
break;
5349
}
5450
}

app/code/Magento/Backup/Test/Unit/Model/BackupFactoryTest.php

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -77,42 +77,29 @@ protected function setUp()
7777

7878
public function testCreate()
7979
{
80-
$this->_backupModel->expects(
81-
$this->once()
82-
)->method(
83-
'setType'
84-
)->with(
85-
$this->_data['type']
86-
)->will(
87-
$this->returnSelf()
88-
);
89-
$this->_backupModel->expects(
90-
$this->once()
91-
)->method(
92-
'setTime'
93-
)->with(
94-
$this->_data['time']
95-
)->will(
96-
$this->returnSelf()
97-
);
98-
$this->_backupModel->expects(
99-
$this->once()
100-
)->method(
101-
'setName'
102-
)->with(
103-
$this->_data['name']
104-
)->will(
105-
$this->returnSelf()
106-
);
107-
$this->_backupModel->expects(
108-
$this->once()
109-
)->method(
110-
'setPath'
111-
)->with(
112-
$this->_data['path']
113-
)->will(
114-
$this->returnSelf()
115-
);
80+
$this->_backupModel->expects($this->once())
81+
->method('setType')
82+
->with($this->_data['type'])
83+
->will($this->returnSelf());
84+
85+
$this->_backupModel->expects($this->once())
86+
->method('setTime')
87+
->with($this->_data['time'])
88+
->will($this->returnSelf());
89+
90+
$this->_backupModel->expects($this->once())
91+
->method('setName')
92+
->with($this->_data['name'])
93+
->will($this->returnSelf());
94+
95+
$this->_backupModel->expects($this->once())
96+
->method('setPath')
97+
->with($this->_data['path'])
98+
->will($this->returnSelf());
99+
100+
$this->_backupModel->expects($this->once())
101+
->method('setData')
102+
->will($this->returnSelf());
116103

117104
$this->_instance->create('1385661590', 'snapshot');
118105
}

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/hosted-fields.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ define([
6161
},
6262

6363
/**
64-
* @returns {Bool}
64+
* @returns {Boolean}
6565
*/
6666
isVaultEnabled: function () {
6767
return this.vaultEnabler.isVaultEnabled();
@@ -144,10 +144,19 @@ define([
144144
},
145145

146146
/**
147-
* Trigger order placing
147+
* Returns state of place order button
148+
* @returns {Boolean}
149+
*/
150+
isButtonActive: function () {
151+
return this.isActive() && this.isPlaceOrderActionAllowed();
152+
},
153+
154+
/**
155+
* Triggers order placing
148156
*/
149157
placeOrderClick: function () {
150158
if (this.validateCardType()) {
159+
this.isPlaceOrderActionAllowed(false);
151160
$(this.getSelector('submit')).trigger('click');
152161
}
153162
},

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@
139139
<button class="action primary checkout"
140140
type="submit"
141141
data-bind="
142-
click: placeOrderClick,
143-
attr: {title: $t('Place Order')},
144-
css: {disabled: !isPlaceOrderActionAllowed()},
145-
enable: isActive()
142+
click: placeOrderClick,
143+
attr: {title: $t('Place Order')},
144+
enable: isButtonActive()
146145
"
147146
disabled>
148147
<span data-bind="i18n: 'Place Order'"></span>

app/code/Magento/Catalog/Model/Product/Attribute/OptionManagement.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ public function getItems($attributeCode)
4040
*/
4141
public function add($attributeCode, $option)
4242
{
43+
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface[] $currentOptions */
44+
$currentOptions = $this->getItems($attributeCode);
45+
if (is_array($currentOptions)) {
46+
array_walk($currentOptions, function (&$attributeOption) {
47+
/** @var \Magento\Eav\Api\Data\AttributeOptionInterface $attributeOption */
48+
$attributeOption = $attributeOption->getLabel();
49+
});
50+
if (in_array($option->getLabel(), $currentOptions)) {
51+
return false;
52+
}
53+
}
4354
return $this->eavOptionManagement->add(
4455
\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE,
4556
$attributeCode,

app/code/Magento/Catalog/Model/Product/Attribute/SetRepository.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function save(\Magento\Eav\Api\Data\AttributeSetInterface $attributeSet)
6262
*/
6363
public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
6464
{
65+
$this->searchCriteriaBuilder->setFilterGroups((array)$searchCriteria->getFilterGroups());
6566
$this->searchCriteriaBuilder->addFilters(
6667
[
6768
$this->filterBuilder
@@ -71,9 +72,15 @@ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCr
7172
->create(),
7273
]
7374
);
75+
76+
$this->searchCriteriaBuilder->setSortOrders((array)$searchCriteria->getSortOrders());
7477
$this->searchCriteriaBuilder->setCurrentPage($searchCriteria->getCurrentPage());
7578
$this->searchCriteriaBuilder->setPageSize($searchCriteria->getPageSize());
76-
return $this->attributeSetRepository->getList($this->searchCriteriaBuilder->create());
79+
80+
$searchResult = $this->attributeSetRepository->getList($this->searchCriteriaBuilder->create());
81+
$searchResult->setSearchCriteria($searchCriteria);
82+
83+
return $searchResult;
7784
}
7885

7986
/**

0 commit comments

Comments
 (0)