Skip to content

Commit 2d5f447

Browse files
Merge branch 'develop' of https://github.corp.magento.com/magento2/magento2ce into MAGETWO-52321
2 parents 4c5e54f + f01f524 commit 2d5f447

File tree

37 files changed

+838
-260
lines changed

37 files changed

+838
-260
lines changed

app/code/Magento/Braintree/Observer/DataAssignObserver.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Framework\Event\Observer;
99
use Magento\Payment\Observer\AbstractDataAssignObserver;
10+
use Magento\Quote\Api\Data\PaymentInterface;
1011

1112
/**
1213
* Class DataAssignObserver
@@ -31,13 +32,19 @@ class DataAssignObserver extends AbstractDataAssignObserver
3132
public function execute(Observer $observer)
3233
{
3334
$data = $this->readDataArgument($observer);
35+
36+
$additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA);
37+
if (!is_array($additionalData)) {
38+
return;
39+
}
40+
3441
$paymentInfo = $this->readPaymentModelArgument($observer);
3542

3643
foreach ($this->additionalInformationList as $additionalInformationKey) {
37-
if ($data->getDataByKey($additionalInformationKey) !== null) {
44+
if (isset($additionalData[$additionalInformationKey])) {
3845
$paymentInfo->setAdditionalInformation(
3946
$additionalInformationKey,
40-
$data->getDataByKey($additionalInformationKey)
47+
$additionalData[$additionalInformationKey]
4148
);
4249
}
4350
}

app/code/Magento/Braintree/Test/Unit/Observer/DataAssignObserverTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Payment\Model\InfoInterface;
1111
use Magento\Payment\Observer\AbstractDataAssignObserver;
1212
use Magento\Braintree\Observer\DataAssignObserver;
13+
use Magento\Quote\Api\Data\PaymentInterface;
1314

1415
/**
1516
* Class DataAssignObserverTest
@@ -30,8 +31,10 @@ public function testExecute()
3031
$paymentInfoModel = $this->getMock(InfoInterface::class);
3132
$dataObject = new DataObject(
3233
[
33-
'payment_method_nonce' => self::PAYMENT_METHOD_NONCE,
34-
'device_data' => self::DEVICE_DATA,
34+
PaymentInterface::KEY_ADDITIONAL_DATA => [
35+
'payment_method_nonce' => self::PAYMENT_METHOD_NONCE,
36+
'device_data' => self::DEVICE_DATA
37+
]
3538
]
3639
);
3740
$observerContainer->expects(static::atLeastOnce())

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ protected function getTierPriceStructure($tierPricePath)
419419
'dndConfig' => [
420420
'enabled' => false,
421421
],
422+
'disabled' => false,
422423
'sortOrder' =>
423424
$this->arrayManager->get($tierPricePath . '/arguments/data/config/sortOrder', $this->meta),
424425
],

app/code/Magento/Checkout/Model/Cart.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,11 @@ public function addOrderItem($orderItem, $qtyFlag = null)
257257
if ($orderItem->getParentItem() === null) {
258258
$storeId = $this->_storeManager->getStore()->getId();
259259
try {
260-
$product = $this->productRepository->getById($orderItem->getProductId(), false, $storeId);
260+
/**
261+
* We need to reload product in this place, because products
262+
* with the same id may have different sets of order attributes.
263+
*/
264+
$product = $this->productRepository->getById($orderItem->getProductId(), false, $storeId, true);
261265
} catch (NoSuchEntityException $e) {
262266
return $this;
263267
}

app/code/Magento/Customer/view/frontend/web/js/password-strength-indicator.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
/**
77
* jshint browser:true
88
*/
9+
/*eslint no-unused-vars: 0*/
910
define([
1011
'jquery',
12+
'Magento_Customer/js/zxcvbn',
1113
'mage/translate',
12-
'Magento_Customer/js/zxcvbn'
13-
], function ($, $t, zxcvbn) {
14+
'mage/validation'
15+
], function ($, zxcvbn, $t, validation) {
1416
'use strict';
1517

1618
$.widget('mage.passwordStrengthIndicator', {
@@ -50,6 +52,8 @@ define([
5052
className = this._getClassName(score);
5153

5254
this._displayStrength(className, score);
55+
//update error messages
56+
$.validator.validateSingleElement(this.element.find('input[type="password"]'));
5357
},
5458

5559
/**

app/code/Magento/ImportExport/Model/Export.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ public static function getStaticAttributeFilterType(\Magento\Eav\Model\Entity\At
238238
return self::FILTER_TYPE_INPUT;
239239
}
240240
$columns = $attribute->getFlatColumns();
241+
if (empty($columns)) {
242+
return self::FILTER_TYPE_INPUT;
243+
}
241244
switch ($columns[$attribute->getAttributeCode()]['type']) {
242245
case \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER:
243246
case \Magento\Framework\DB\Ddl\Table::TYPE_BIGINT:

app/code/Magento/OfflinePayments/Model/Purchaseorder.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ class Purchaseorder extends \Magento\Payment\Model\Method\AbstractMethod
4747
*/
4848
public function assignData(\Magento\Framework\DataObject $data)
4949
{
50-
if (!$data instanceof \Magento\Framework\DataObject) {
51-
$data = new \Magento\Framework\DataObject($data);
52-
}
53-
5450
$this->getInfoInstance()->setPoNumber($data->getPoNumber());
5551
return $this;
5652
}

app/code/Magento/Payment/Model/Info.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@ protected function _initAdditionalInformation()
220220
{
221221
$additionalInfo = $this->_getData('additional_information');
222222
if (empty($this->_additionalInformation) && $additionalInfo) {
223-
if (!is_array($additionalInfo)) {
224-
$additionalInfo = unserialize($additionalInfo);
225-
}
226223
$this->_additionalInformation = $additionalInfo;
227224
}
228225
}

app/code/Magento/Payment/Model/Method/AbstractMethod.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
2222
* @SuppressWarnings(PHPMD.TooManyFields)
2323
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
24+
* @deprecated
2425
*/
2526
abstract class AbstractMethod extends \Magento\Framework\Model\AbstractExtensibleModel implements
2627
MethodInterface,
@@ -769,12 +770,6 @@ public function getConfigData($field, $storeId = null)
769770
*/
770771
public function assignData(\Magento\Framework\DataObject $data)
771772
{
772-
if (is_array($data)) {
773-
$this->getInfoInstance()->addData($data);
774-
} elseif ($data instanceof \Magento\Framework\DataObject) {
775-
$this->getInfoInstance()->addData($data->getData());
776-
}
777-
778773
$this->_eventManager->dispatch(
779774
'payment_method_assign_data_' . $this->getCode(),
780775
[

app/code/Magento/Payment/Test/Unit/Model/InfoTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ public function ccKeysDataProvider()
9090
];
9191
}
9292

93-
9493
public function testGetMethodInstanceWithRealMethod()
9594
{
9695
$method = 'real_method';
@@ -108,7 +107,6 @@ public function testGetMethodInstanceWithRealMethod()
108107
$this->info->getMethodInstance();
109108
}
110109

111-
112110
public function testGetMethodInstanceWithUnrealMethod()
113111
{
114112
$method = 'unreal_method';
@@ -131,7 +129,6 @@ public function testGetMethodInstanceWithUnrealMethod()
131129
$this->info->getMethodInstance();
132130
}
133131

134-
135132
/**
136133
* @expectedException \Magento\Framework\Exception\LocalizedException
137134
* @expectedExceptionMessage The payment method you requested is not available.
@@ -141,8 +138,7 @@ public function testGetMethodInstanceWithNoMethod()
141138
$this->info->setData('method', false);
142139
$this->info->getMethodInstance();
143140
}
144-
145-
141+
146142
public function testGetMethodInstanceRequestedMethod()
147143
{
148144
$code = 'real_method';
@@ -251,9 +247,9 @@ public function testHasAdditionalInformation()
251247

252248
public function testInitAdditionalInformationWithUnserialize()
253249
{
254-
$data = serialize(['key1' => 'data1', 'key2' => 'data2']);
250+
$data = ['key1' => 'data1', 'key2' => 'data2'];
255251
$this->info->setData('additional_information', $data);
256252

257-
$this->assertEquals(unserialize($data), $this->info->getAdditionalInformation());
253+
$this->assertEquals($data, $this->info->getAdditionalInformation());
258254
}
259255
}

0 commit comments

Comments
 (0)