Skip to content

Commit fa973d8

Browse files
merge magento/2.3.3-develop into magento-qwerty/MC-19145
2 parents ea48727 + a6e663e commit fa973d8

File tree

33 files changed

+596
-78
lines changed

33 files changed

+596
-78
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
9+
<default>
10+
<admin>
11+
<usage>
12+
<enabled>
13+
1
14+
</enabled>
15+
</usage>
16+
</admin>
17+
</default>
18+
</config>

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,10 @@ define(
246246
return;
247247
}
248248

249-
self.setPaymentPayload(payload);
250-
self.placeOrder();
249+
if (self.validateCardType()) {
250+
self.setPaymentPayload(payload);
251+
self.placeOrder();
252+
}
251253
});
252254
}
253255
},

app/code/Magento/Catalog/view/frontend/web/js/related-products.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ define([
2626
* @private
2727
*/
2828
_create: function () {
29-
$(this.options.selectAllLink).on('click', $.proxy(this._selectAllRelated, this));
30-
$(this.options.relatedCheckbox).on('click', $.proxy(this._addRelatedToProduct, this));
29+
$(this.options.selectAllLink, this.element).on('click', $.proxy(this._selectAllRelated, this));
30+
$(this.options.relatedCheckbox, this.element).on('click', $.proxy(this._addRelatedToProduct, this));
3131
this._showRelatedProducts(
3232
this.element.find(this.options.elementsSelector),
3333
this.element.data('limit'),

app/code/Magento/Checkout/view/frontend/templates/onepage/review/item.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ $taxDataHelper = $this->helper(Magento\Tax\Helper\Data::class);
2828
<dt><?= $block->escapeHtml($_option['label']) ?></dt>
2929
<dd>
3030
<?php if (isset($_formatedOptionValue['full_view'])) :?>
31-
<?= $block->escapeHtml($_formatedOptionValue['full_view']) ?>
31+
<?= /* @noEscape */ $_formatedOptionValue['full_view'] ?>
3232
<?php else :?>
33-
<?= $block->escapeHtml($_formatedOptionValue['value']) ?>
33+
<?= /* @noEscape */ $_formatedOptionValue['value'] ?>
3434
<?php endif; ?>
3535
</dd>
3636
<?php endforeach; ?>

app/code/Magento/Checkout/view/frontend/web/js/action/select-payment-method.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ define([
1212
'use strict';
1313

1414
return function (paymentMethod) {
15-
paymentMethod.__disableTmpl = {
16-
title: true
17-
};
18-
15+
if (paymentMethod) {
16+
paymentMethod.__disableTmpl = {
17+
title: true
18+
};
19+
}
1920
quote.paymentMethod(paymentMethod);
2021
};
2122
});

app/code/Magento/Checkout/view/frontend/web/js/action/set-payment-information-extended.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,33 @@ define([
1313
'Magento_Checkout/js/model/error-processor',
1414
'Magento_Customer/js/model/customer',
1515
'Magento_Checkout/js/action/get-totals',
16-
'Magento_Checkout/js/model/full-screen-loader'
17-
], function (quote, urlBuilder, storage, errorProcessor, customer, getTotalsAction, fullScreenLoader) {
16+
'Magento_Checkout/js/model/full-screen-loader',
17+
'underscore'
18+
], function (quote, urlBuilder, storage, errorProcessor, customer, getTotalsAction, fullScreenLoader, _) {
1819
'use strict';
1920

21+
/**
22+
* Filter template data.
23+
*
24+
* @param {Object|Array} data
25+
*/
26+
var filterTemplateData = function (data) {
27+
return _.each(data, function (value, key, list) {
28+
if (_.isArray(value) || _.isObject(value)) {
29+
list[key] = filterTemplateData(value);
30+
}
31+
32+
if (key === '__disableTmpl') {
33+
delete list[key];
34+
}
35+
});
36+
};
37+
2038
return function (messageContainer, paymentData, skipBilling) {
2139
var serviceUrl,
2240
payload;
2341

42+
paymentData = filterTemplateData(paymentData);
2443
skipBilling = skipBilling || false;
2544
payload = {
2645
cartId: quote.getQuoteId(),

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ define([
1313
'jquery-ui-modules/widget',
1414
'mage/decorate',
1515
'mage/collapsible',
16-
'mage/cookies'
16+
'mage/cookies',
17+
'jquery-ui-modules/effect-fade'
1718
], function ($, authenticationPopup, customerData, alert, confirm, _) {
1819
'use strict';
1920

app/code/Magento/MysqlMq/Model/ResourceModel/Queue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function getMessages($queueName, $limit = null)
151151
'queue_message_status.status IN (?)',
152152
[QueueManagement::MESSAGE_STATUS_NEW, QueueManagement::MESSAGE_STATUS_RETRY_REQUIRED]
153153
)->where('queue.name = ?', $queueName)
154-
->order('queue_message_status.updated_at ASC');
154+
->order(['queue_message_status.updated_at ASC', 'queue_message_status.id ASC']);
155155

156156
if ($limit) {
157157
$select->limit($limit);

app/code/Magento/MysqlMq/Test/Unit/Model/ResourceModel/QueueTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ public function testGetMessages()
206206
]
207207
)->willReturnSelf();
208208
$select->expects($this->once())
209-
->method('order')->with('queue_message_status.updated_at ASC')->willReturnSelf();
209+
->method('order')
210+
->with(['queue_message_status.updated_at ASC', 'queue_message_status.id ASC'])
211+
->willReturnSelf();
210212
$select->expects($this->once())->method('limit')->with($limit)->willReturnSelf();
211213
$connection->expects($this->once())->method('fetchAll')->with($select)->willReturn($messages);
212214
$this->assertEquals($messages, $this->queue->getMessages($queueName, $limit));

app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
namespace Magento\Persistent\Observer;
77

88
use Magento\Framework\Event\ObserverInterface;
9+
use Magento\Framework\Exception\NoSuchEntityException;
10+
use Magento\Quote\Api\CartRepositoryInterface;
11+
use Magento\Quote\Api\Data\CartInterface;
912
use Magento\Quote\Model\Quote;
1013

1114
/**
@@ -74,6 +77,11 @@ class CheckExpirePersistentQuoteObserver implements ObserverInterface
7477
*/
7578
private $quote;
7679

80+
/**
81+
* @var CartRepositoryInterface
82+
*/
83+
private $quoteRepository;
84+
7785
/**
7886
* @param \Magento\Persistent\Helper\Session $persistentSession
7987
* @param \Magento\Persistent\Helper\Data $persistentData
@@ -82,6 +90,7 @@ class CheckExpirePersistentQuoteObserver implements ObserverInterface
8290
* @param \Magento\Customer\Model\Session $customerSession
8391
* @param \Magento\Checkout\Model\Session $checkoutSession
8492
* @param \Magento\Framework\App\RequestInterface $request
93+
* @param CartRepositoryInterface $quoteRepository
8594
*/
8695
public function __construct(
8796
\Magento\Persistent\Helper\Session $persistentSession,
@@ -90,7 +99,8 @@ public function __construct(
9099
\Magento\Framework\Event\ManagerInterface $eventManager,
91100
\Magento\Customer\Model\Session $customerSession,
92101
\Magento\Checkout\Model\Session $checkoutSession,
93-
\Magento\Framework\App\RequestInterface $request
102+
\Magento\Framework\App\RequestInterface $request,
103+
CartRepositoryInterface $quoteRepository
94104
) {
95105
$this->_persistentSession = $persistentSession;
96106
$this->quoteManager = $quoteManager;
@@ -99,6 +109,7 @@ public function __construct(
99109
$this->_eventManager = $eventManager;
100110
$this->_persistentData = $persistentData;
101111
$this->request = $request;
112+
$this->quoteRepository = $quoteRepository;
102113
}
103114

104115
/**
@@ -146,9 +157,11 @@ public function execute(\Magento\Framework\Event\Observer $observer)
146157
*/
147158
private function isPersistentQuoteOutdated(): bool
148159
{
149-
if ((!$this->_persistentData->isEnabled() || !$this->_persistentData->isShoppingCartPersist())
160+
if (!($this->_persistentData->isEnabled() && $this->_persistentData->isShoppingCartPersist())
150161
&& !$this->_customerSession->isLoggedIn()
151-
&& $this->_checkoutSession->getQuoteId()) {
162+
&& $this->_checkoutSession->getQuoteId()
163+
&& $this->isActiveQuote()
164+
) {
152165
return (bool)$this->getQuote()->getIsPersistent();
153166
}
154167
return false;
@@ -181,6 +194,21 @@ private function getQuote(): Quote
181194
return $this->quote;
182195
}
183196

197+
/**
198+
* Check if quote is active.
199+
*
200+
* @return bool
201+
*/
202+
private function isActiveQuote(): bool
203+
{
204+
try {
205+
$this->quoteRepository->getActive($this->_checkoutSession->getQuoteId());
206+
return true;
207+
} catch (NoSuchEntityException $e) {
208+
return false;
209+
}
210+
}
211+
184212
/**
185213
* Check current request is coming from onepage checkout page.
186214
*

0 commit comments

Comments
 (0)