Skip to content

Commit df6b49f

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into 2.2-develop-pr51
2 parents d895fab + d65f99a commit df6b49f

File tree

9 files changed

+53
-12
lines changed

9 files changed

+53
-12
lines changed

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,20 @@ public function getSearchableAttributes($backendType = null)
316316
/** @var \Magento\Eav\Model\Entity\Attribute[] $attributes */
317317
$attributes = $productAttributes->getItems();
318318

319+
/**
320+
* @deprecated Event argument catelogsearch_searchable_attributes_load_after.
321+
* @see catalogsearch_searchable_attributes_load_after instead.
322+
*/
319323
$this->eventManager->dispatch(
320324
'catelogsearch_searchable_attributes_load_after',
321325
['engine' => $this->engine, 'attributes' => $attributes]
322326
);
323327

328+
$this->eventManager->dispatch(
329+
'catalogsearch_searchable_attributes_load_after',
330+
['engine' => $this->engine, 'attributes' => $attributes]
331+
);
332+
324333
$entity = $this->eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY)->getEntity();
325334

326335
foreach ($attributes as $attribute) {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ public function savePaymentInformation(
114114
$quote->setDataChanges(true);
115115
$shippingAddress = $quote->getShippingAddress();
116116
if ($shippingAddress && $shippingAddress->getShippingMethod()) {
117-
$shippingDataArray = explode('_', $shippingAddress->getShippingMethod());
118-
$shippingCarrier = array_shift($shippingDataArray);
119-
$shippingAddress->setLimitCarrier($shippingCarrier);
117+
$shippingRate = $shippingAddress->getShippingRateByCode($shippingAddress->getShippingMethod());
118+
$shippingAddress->setLimitCarrier($shippingRate->getCarrier());
120119
}
121120
}
122121
$this->paymentMethodManagement->set($cartId, $paymentMethod);

app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,11 @@ private function getMockForAssignBillingAddress($cartId, $billingAddressMock)
168168
$billingAddressId = 1;
169169
$quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class);
170170
$quoteBillingAddress = $this->createMock(\Magento\Quote\Model\Quote\Address::class);
171+
$shippingRate = $this->createPartialMock(\Magento\Quote\Model\Quote\Address\Rate::class, []);
172+
$shippingRate->setCarrier('flatrate');
171173
$quoteShippingAddress = $this->createPartialMock(
172174
\Magento\Quote\Model\Quote\Address::class,
173-
['setLimitCarrier', 'getShippingMethod']
175+
['setLimitCarrier', 'getShippingMethod', 'getShippingRateByCode']
174176
);
175177
$this->cartRepositoryMock->expects($this->any())->method('getActive')->with($cartId)->willReturn($quoteMock);
176178
$quoteMock->expects($this->once())->method('getBillingAddress')->willReturn($quoteBillingAddress);
@@ -179,6 +181,7 @@ private function getMockForAssignBillingAddress($cartId, $billingAddressMock)
179181
$quoteMock->expects($this->once())->method('removeAddress')->with($billingAddressId);
180182
$quoteMock->expects($this->once())->method('setBillingAddress')->with($billingAddressMock);
181183
$quoteMock->expects($this->once())->method('setDataChanges')->willReturnSelf();
184+
$quoteShippingAddress->expects($this->any())->method('getShippingRateByCode')->willReturn($shippingRate);
182185
$quoteShippingAddress->expects($this->any())->method('getShippingMethod')->willReturn('flatrate_flatrate');
183186
$quoteShippingAddress->expects($this->once())->method('setLimitCarrier')->with('flatrate')->willReturnSelf();
184187
}

app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,31 @@ define([
218218
* Apply resolved billing address to quote
219219
*/
220220
applyBillingAddress: function () {
221-
var shippingAddress;
221+
var shippingAddress,
222+
isBillingAddressInitialized;
222223

223224
if (quote.billingAddress()) {
224225
selectBillingAddress(quote.billingAddress());
225226

226227
return;
227228
}
229+
230+
if (quote.isVirtual()) {
231+
isBillingAddressInitialized = addressList.some(function (addrs) {
232+
if (addrs.isDefaultBilling()) {
233+
selectBillingAddress(addrs);
234+
235+
return true;
236+
}
237+
238+
return false;
239+
});
240+
}
241+
228242
shippingAddress = quote.shippingAddress();
229243

230-
if (shippingAddress &&
244+
if (!isBillingAddressInitialized &&
245+
shippingAddress &&
231246
shippingAddress.canUseForBilling() &&
232247
(shippingAddress.isDefaultShipping() || !quote.isVirtual())
233248
) {

app/code/Magento/Quote/Model/BillingAddressManagement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres
7676
{
7777
/** @var \Magento\Quote\Model\Quote $quote */
7878
$quote = $this->quoteRepository->getActive($cartId);
79+
$address->setCustomerId($quote->getCustomerId());
7980
$quote->removeAddress($quote->getBillingAddress()->getId());
8081
$quote->setBillingAddress($address);
8182
try {

dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/cc-form.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ define([
1919
billingAddress: ko.observable(),
2020
shippingAddress: ko.observable(),
2121
paymentMethod: ko.observable(),
22-
totals: ko.observable({})
22+
totals: ko.observable({}),
23+
24+
/** Stub */
25+
isVirtual: function () {
26+
return false;
27+
}
2328
},
2429
'Magento_Braintree/js/view/payment/validator-handler': jasmine.createSpyObj(
2530
'validator-handler',

dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ define([
2424
paymentMethod: ko.observable(),
2525
totals: ko.observable({
2626
'base_grand_total': 0
27-
})
27+
}),
28+
29+
/** Stub */
30+
isVirtual: function () {
31+
return false;
32+
}
2833
},
2934
'Magento_Braintree/js/view/payment/adapter': {
3035
config: {},

dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ define([
2828
billingAddress: ko.observable(),
2929
shippingAddress: ko.observable(),
3030
paymentMethod: ko.observable(),
31-
totals: ko.observable({})
31+
totals: ko.observable({}),
3232

33+
/** Stub */
34+
isVirtual: function () {
35+
return false;
36+
}
3337
},
3438
'Magento_Checkout/js/action/set-payment-information': setPaymentMock,
3539
'Magento_Checkout/js/model/payment/additional-validators': {

setup/performance-toolkit/benchmark.jmx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2535,21 +2535,21 @@ if (props.get("category_names_list") == null) {
25352535
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
25362536
<collectionProp name="Arguments.arguments">
25372537
<elementProp name="blocks" elementType="HTTPArgument">
2538-
<boolProp name="HTTPArgument.always_encode">false</boolProp>
2538+
<boolProp name="HTTPArgument.always_encode">true</boolProp>
25392539
<stringProp name="Argument.value">["customer_form_login"]</stringProp>
25402540
<stringProp name="Argument.metadata">=</stringProp>
25412541
<boolProp name="HTTPArgument.use_equals">true</boolProp>
25422542
<stringProp name="Argument.name">blocks</stringProp>
25432543
</elementProp>
25442544
<elementProp name="handles" elementType="HTTPArgument">
2545-
<boolProp name="HTTPArgument.always_encode">false</boolProp>
2545+
<boolProp name="HTTPArgument.always_encode">true</boolProp>
25462546
<stringProp name="Argument.value">["default","customer_account_login"]</stringProp>
25472547
<stringProp name="Argument.metadata">=</stringProp>
25482548
<boolProp name="HTTPArgument.use_equals">true</boolProp>
25492549
<stringProp name="Argument.name">handles</stringProp>
25502550
</elementProp>
25512551
<elementProp name="originalRequest" elementType="HTTPArgument">
2552-
<boolProp name="HTTPArgument.always_encode">false</boolProp>
2552+
<boolProp name="HTTPArgument.always_encode">true</boolProp>
25532553
<stringProp name="Argument.value">{"route":"customer","controller":"account","action":"login","uri":"/customer/account/login/"}</stringProp>
25542554
<stringProp name="Argument.metadata">=</stringProp>
25552555
<boolProp name="HTTPArgument.use_equals">true</boolProp>

0 commit comments

Comments
 (0)