Skip to content

Commit ed9e698

Browse files
committed
Merge branch 'develop' of github.com:magento/magento2ce into develop-prs
2 parents f6ca94c + cd4d690 commit ed9e698

File tree

14 files changed

+223
-90
lines changed

14 files changed

+223
-90
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ define([
1919
quote.shippingAddress.subscribe(function () {
2020
var type = quote.shippingAddress().getType();
2121

22-
if (quote.isVirtual()) {
22+
if (
23+
quote.isVirtual() ||
24+
window.checkoutConfig.activeCarriers && window.checkoutConfig.activeCarriers.length === 0
25+
) {
2326
// update totals block when estimated address was set
2427
totalsProcessors['default'] = totalsDefaultProvider;
2528
totalsProcessors[type] ?
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([], function () {
7+
'use strict';
8+
9+
return {
10+
/**
11+
* @return {Object}
12+
*/
13+
getRules: function () {
14+
return {
15+
'country_id': {
16+
'required': true
17+
}
18+
};
19+
}
20+
};
21+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'mageUtils',
9+
'./default-validation-rules',
10+
'mage/translate'
11+
], function ($, utils, validationRules, $t) {
12+
'use strict';
13+
14+
return {
15+
validationErrors: [],
16+
17+
/**
18+
* @param {Object} address
19+
* @return {Boolean}
20+
*/
21+
validate: function (address) {
22+
var self = this;
23+
24+
this.validationErrors = [];
25+
$.each(validationRules.getRules(), function (field, rule) {
26+
var message;
27+
28+
if (rule.required && utils.isEmpty(address[field])) {
29+
message = $t('Field ') + field + $t(' is required.');
30+
31+
self.validationErrors.push(message);
32+
}
33+
});
34+
35+
return !this.validationErrors.length;
36+
}
37+
};
38+
});

app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ define([
1313
'../model/address-converter',
1414
'../action/select-shipping-address',
1515
'./postcode-validator',
16+
'./default-validator',
1617
'mage/translate',
1718
'uiRegistry',
1819
'Magento_Checkout/js/model/shipping-address/form-popup-state',
@@ -24,6 +25,7 @@ define([
2425
addressConverter,
2526
selectShippingAddress,
2627
postcodeValidator,
28+
defaultValidator,
2729
$t,
2830
uiRegistry,
2931
formPopUpState
@@ -36,6 +38,8 @@ define([
3638
postcodeElement = null,
3739
postcodeElementName = 'postcode';
3840

41+
validators.push(defaultValidator);
42+
3943
return {
4044
validateAddressTimeout: 0,
4145
validateDelay: 2000,

app/code/Magento/Store/etc/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@
130130
<public_files_valid_paths>
131131
<protected>
132132
<app>/app/*/*</app>
133+
<bin>/bin/*/*</bin>
134+
<dev>/dev/*/*</dev>
135+
<generated>/generated/*/*</generated>
136+
<lib>/lib/*/*</lib>
137+
<setup>/setup/*/*</setup>
138+
<update>/update/*/*</update>
139+
<vendor>/vendor/*/*</vendor>
133140
</protected>
134141
</public_files_valid_paths>
135142
</file>

app/code/Magento/Webapi/Test/Unit/Model/DataObjectProcessorTest.php

Lines changed: 0 additions & 74 deletions
This file was deleted.

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ public function testProductLinks()
344344
"link_type" => "related",
345345
"linked_product_sku" => "product_simple_500",
346346
"linked_product_type" => "simple",
347-
"position" => 0,
348-
"extension_attributes" => []
347+
"position" => 0
349348
];
350349
$productWithRelatedData = [
351350
ProductInterface::SKU => "product_simple_with_related_500",
@@ -373,8 +372,7 @@ public function testProductLinks()
373372
"link_type" => "upsell",
374373
"linked_product_sku" => "product_simple_500",
375374
"linked_product_type" => "simple",
376-
"position" => 0,
377-
"extension_attributes" => []
375+
"position" => 0
378376
];
379377
$productWithUpsellData = [
380378
ProductInterface::SKU => "product_simple_with_related_500",

dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/ConfigurableProductManagementTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ public function testGetVariation()
6969
'value' => $attributeOptionValue
7070
]
7171
],
72-
'tier_prices' => [],
73-
'extension_attributes' => []
72+
'tier_prices' => []
7473
]
7574
];
7675
ksort($expectedItems);

dev/tests/api-functional/testsuite/Magento/GroupedProduct/Api/ProductRepositoryInterfaceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function testProductLinks()
162162
"position" => 0, "extension_attributes" => ["qty" => 4]];
163163
$productLinkData2 = ["sku" => "group_product_500", "link_type" => "upsell",
164164
"linked_product_sku" => "product_simple_500", "linked_product_type" => "simple",
165-
"position" => 0, "extension_attributes" => []];
165+
"position" => 0];
166166
$productWithGroupData = [
167167
ProductInterface::SKU => "group_product_500",
168168
ProductInterface::NAME => "Group Product 500",

dev/tests/integration/testsuite/Magento/Customer/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,16 @@ public function tearDown()
9999
*/
100100
public function testGetCustomer()
101101
{
102-
$expectedCustomerData = $this->_loadCustomer()->__toArray();
103-
$actualCustomerData = $this->_block->getCustomer()->__toArray();
102+
$expectedCustomer = $this->_loadCustomer();
103+
$expectedCustomerData = $this->_dataObjectProcessor->buildOutputDataArray(
104+
$expectedCustomer,
105+
\Magento\Customer\Api\Data\CustomerInterface::class
106+
);
107+
$actualCustomer = $this->_block->getCustomer();
108+
$actualCustomerData = $this->_dataObjectProcessor->buildOutputDataArray(
109+
$actualCustomer,
110+
\Magento\Customer\Api\Data\CustomerInterface::class
111+
);
104112
foreach ($expectedCustomerData as $property => $value) {
105113
$expectedValue = is_numeric($value) ? intval($value) : $value;
106114
$actualValue = isset($actualCustomerData[$property]) ? $actualCustomerData[$property] : null;

0 commit comments

Comments
 (0)