Skip to content

Commit f77f96b

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #19659: Fix issue #19657- Select Option Space issue into backend (by @speedy008) - #19617: Additional Cache Management title (by @thomas-blackbird) - #19583: MAGETWO-96618: JS files relocation BC in 2.3 too (by @rbayet) - #19569: Fixed issue with Base Currency for website is CND when PayPal Payflow� (by @jignesh-baldha) - #19249: fix php 7.2 error : Countable interface not implemented (by @gmachure) - #19164: Fixed subscribe to newsletter if you already have an account issue #8952 -2.3 develop (by @ravi-chandra3197) - #18832: Cancel expired orders using OrderManagementInterface (by @JeroenVanLeusden) - #18768: Collect totals in placeOrder when no paymentMethod provided (by @pmclain) - #18521: [Forwardport] Added checks to see if the payment is available (by @gelanivishal) Fixed GitHub Issues: - #19657: Select Option Space issue into backend (reported by @speedy008) has been fixed in #19659 by @speedy008 in 2.3-develop branch Related commits: 1. 29f6be1 - #16302: JS files located outside the web/js directory (reported by @BenSpace48) has been fixed in #19583 by @rbayet in 2.3-develop branch Related commits: 1. f38f09f - #19291: JS files relocation inside the web/js directory not BC in 2.3.x (reported by @rbayet) has been fixed in #19583 by @rbayet in 2.3-develop branch Related commits: 1. f38f09f - #19247: Magento 2 : fix php 7.2 error : Countable interface not implemented (reported by @gmachure) has been fixed in #19249 by @gmachure in 2.3-develop branch Related commits: 1. f1e7e3f 2. a7b9122 - #8952: You can't subscribe to newsletter if you already have an account (reported by @loomdecor) has been fixed in #19164 by @ravi-chandra3197 in 2.3-develop branch Related commits: 1. 78b694f 2. ebfffe4 3. b8941a8 - #16050: Authorize.net (reported by @milenavasic) has been fixed in #18768 by @pmclain in 2.3-develop branch Related commits: 1. 7bc9c31 2. 389a16b - #15652: REST API create order POST /V1/orders (reported by @bibiseb) has been fixed in #18521 by @gelanivishal in 2.3-develop branch Related commits: 1. 14b3eaf 2. 3eb6c3e
2 parents 6478d2b + feac5fa commit f77f96b

File tree

26 files changed

+154
-39
lines changed

26 files changed

+154
-39
lines changed

app/code/Magento/Authorizenet/view/frontend/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
transparent: 'Magento_Payment/js/transparent'
9+
transparent: 'Magento_Payment/js/transparent',
10+
'Magento_Payment/transparent': 'Magento_Payment/js/transparent'
1011
}
1112
}
1213
};

app/code/Magento/Backend/view/adminhtml/templates/system/cache/additional.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ $permissions = $block->getData('permissions');
1111
?>
1212
<?php if ($permissions && $permissions->hasAccessToAdditionalActions()): ?>
1313
<div class="additional-cache-management">
14+
<h2>
15+
<span><?= $block->escapeHtml(__('Additional Cache Management')); ?></span>
16+
</h2>
1417
<?php if ($permissions->hasAccessToFlushCatalogImages()): ?>
15-
<h2>
16-
<span><?= $block->escapeHtml(__('Additional Cache Management')); ?></span>
17-
</h2>
1818
<p>
1919
<button onclick="setLocation('<?= $block->escapeJs($block->getCleanImagesUrl()); ?>')" type="button">
2020
<?= $block->escapeHtml(__('Flush Catalog Images Cache')); ?>

app/code/Magento/Captcha/view/frontend/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
captcha: 'Magento_Captcha/js/captcha'
9+
captcha: 'Magento_Captcha/js/captcha',
10+
'Magento_Captcha/captcha': 'Magento_Captcha/js/captcha'
1011
}
1112
}
1213
};

app/code/Magento/Customer/view/frontend/requirejs-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ var config = {
1111
changeEmailPassword: 'Magento_Customer/js/change-email-password',
1212
passwordStrengthIndicator: 'Magento_Customer/js/password-strength-indicator',
1313
zxcvbn: 'Magento_Customer/js/zxcvbn',
14-
addressValidation: 'Magento_Customer/js/addressValidation'
14+
addressValidation: 'Magento_Customer/js/addressValidation',
15+
'Magento_Customer/address': 'Magento_Customer/js/address',
16+
'Magento_Customer/change-email-password': 'Magento_Customer/js/change-email-password'
1517
}
1618
}
1719
};

app/code/Magento/Downloadable/view/frontend/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
downloadable: 'Magento_Downloadable/js/downloadable'
9+
downloadable: 'Magento_Downloadable/js/downloadable',
10+
'Magento_Downloadable/downloadable': 'Magento_Downloadable/js/downloadable'
1011
}
1112
}
1213
};

app/code/Magento/GiftMessage/view/frontend/requirejs-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ var config = {
77
map: {
88
'*': {
99
giftOptions: 'Magento_GiftMessage/js/gift-options',
10-
extraOptions: 'Magento_GiftMessage/js/extra-options'
10+
extraOptions: 'Magento_GiftMessage/js/extra-options',
11+
'Magento_GiftMessage/gift-options': 'Magento_GiftMessage/js/gift-options',
12+
'Magento_GiftMessage/extra-options': 'Magento_GiftMessage/js/extra-options'
1113
}
1214
}
1315
};

app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ public function __construct(
8080
protected function validateEmailAvailable($email)
8181
{
8282
$websiteId = $this->_storeManager->getStore()->getWebsiteId();
83-
if ($this->_customerSession->getCustomerDataObject()->getEmail() !== $email
84-
&& !$this->customerAccountManagement->isEmailAvailable($email, $websiteId)
83+
if ($this->_customerSession->isLoggedIn()
84+
&& ($this->_customerSession->getCustomerDataObject()->getEmail() !== $email
85+
&& !$this->customerAccountManagement->isEmailAvailable($email, $websiteId))
8586
) {
8687
throw new LocalizedException(
8788
__('This email address is already assigned to another user.')

app/code/Magento/Payment/Observer/SalesOrderBeforeSaveObserver.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,29 @@
88

99
use Magento\Framework\Event\ObserverInterface;
1010

11+
/**
12+
* Verify order payment observer
13+
*/
1114
class SalesOrderBeforeSaveObserver implements ObserverInterface
1215
{
1316
/**
1417
* Set forced canCreditmemo flag
1518
*
1619
* @param \Magento\Framework\Event\Observer $observer
1720
* @return $this
21+
* @throws \Magento\Framework\Exception\LocalizedException in case order has no payment specified.
1822
*/
1923
public function execute(\Magento\Framework\Event\Observer $observer)
2024
{
2125
/** @var \Magento\Sales\Model\Order $order */
2226
$order = $observer->getEvent()->getOrder();
2327

28+
if (!$order->getPayment()) {
29+
throw new \Magento\Framework\Exception\LocalizedException(
30+
__('Please provide payment for the order.')
31+
);
32+
}
33+
2434
if ($order->getPayment()->getMethodInstance()->getCode() != 'free') {
2535
return $this;
2636
}

app/code/Magento/Payment/Test/Unit/Observer/SalesOrderBeforeSaveObserverTest.php

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testSalesOrderBeforeSaveCantUnhold()
6161
$paymentMock = $this->getMockBuilder(
6262
\Magento\Sales\Model\Order\Payment::class
6363
)->disableOriginalConstructor()->setMethods([])->getMock();
64-
$order->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock));
64+
$order->method('getPayment')->will($this->returnValue($paymentMock));
6565
$methodInstance = $this->getMockBuilder(
6666
\Magento\Payment\Model\MethodInterface::class
6767
)->getMockForAbstractClass();
@@ -86,7 +86,7 @@ public function testSalesOrderBeforeSaveIsCanceled()
8686
$paymentMock = $this->getMockBuilder(
8787
\Magento\Sales\Model\Order\Payment::class
8888
)->disableOriginalConstructor()->setMethods([])->getMock();
89-
$order->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock));
89+
$order->method('getPayment')->will($this->returnValue($paymentMock));
9090
$methodInstance = $this->getMockBuilder(
9191
\Magento\Payment\Model\MethodInterface::class
9292
)->getMockForAbstractClass();
@@ -114,7 +114,7 @@ public function testSalesOrderBeforeSaveIsClosed()
114114
$paymentMock = $this->getMockBuilder(
115115
\Magento\Sales\Model\Order\Payment::class
116116
)->disableOriginalConstructor()->setMethods([])->getMock();
117-
$order->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock));
117+
$order->method('getPayment')->will($this->returnValue($paymentMock));
118118
$methodInstance = $this->getMockBuilder(
119119
\Magento\Payment\Model\MethodInterface::class
120120
)->getMockForAbstractClass();
@@ -156,6 +156,29 @@ public function testSalesOrderBeforeSaveSetForced()
156156
$this->salesOrderBeforeSaveObserver->execute($this->observerMock);
157157
}
158158

159+
/**
160+
* The method should check that the payment is available, as this is not always the case.
161+
*
162+
* @expectedException \Magento\Framework\Exception\LocalizedException
163+
* @exceptedExceptionMessage Please provide payment for the order.
164+
*/
165+
public function testDoesNothingWhenNoPaymentIsAvailable()
166+
{
167+
$this->_prepareEventMockWithMethods(['getOrder']);
168+
169+
$order = $this->getMockBuilder(\Magento\Sales\Model\Order::class)->disableOriginalConstructor()->setMethods(
170+
array_merge(['__wakeup', 'getPayment'])
171+
)->getMock();
172+
173+
$this->eventMock->expects($this->once())->method('getOrder')->will(
174+
$this->returnValue($order)
175+
);
176+
177+
$order->expects($this->exactly(1))->method('getPayment')->willReturn(null);
178+
179+
$this->salesOrderBeforeSaveObserver->execute($this->observerMock);
180+
}
181+
159182
/**
160183
* Prepares EventMock with set of methods
161184
*
@@ -184,7 +207,7 @@ private function _getPreparedOrderMethod($methodCode, $orderMethods = [])
184207
$paymentMock = $this->getMockBuilder(
185208
\Magento\Sales\Model\Order\Payment::class
186209
)->disableOriginalConstructor()->setMethods([])->getMock();
187-
$order->expects($this->once())->method('getPayment')->will($this->returnValue($paymentMock));
210+
$order->method('getPayment')->will($this->returnValue($paymentMock));
188211
$methodInstance = $this->getMockBuilder(
189212
\Magento\Payment\Model\MethodInterface::class
190213
)->getMockForAbstractClass();

app/code/Magento/Payment/view/frontend/requirejs-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
var config = {
77
map: {
88
'*': {
9-
creditCardType: 'Magento_Payment/js/cc-type'
9+
creditCardType: 'Magento_Payment/js/cc-type',
10+
'Magento_Payment/cc-type': 'Magento_Payment/js/cc-type'
1011
}
1112
}
1213
};

0 commit comments

Comments
 (0)