Skip to content

Commit 81ace6a

Browse files
author
Oleksii Korshenko
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento-engcom/magento2ce#1323: [EngCom Team] Batch 21. Forwardports to 2.3-develop (by @magento-engcom-team) - magento-engcom/magento2ce#1298: [EngCom Team] Batch 13. Forwardports to 2.3-develop (by @magento-engcom-team) Fixed GitHub Issues: - #9684: No ACL set for integrations (reported by @wigman) has been fixed in magento-engcom/magento2ce#1323 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 809ed03 2. de9d15a 3. b322c09 4. 703d9e0 5. ecfe901 6. a90dbca 7. b4a7213 8. 660c62a 9. 8d48fd3 10. d0b525b 11. 0dd84cd 12. 6746da4 13. 413f939 14. 2eca1d0 15. f9976b9 16. 4c77e4f 17. 6c62727 18. d891503 19. d10f55e 20. e2ff943 21. e27445d 22. f0711ed 23. 79de0d6 24. a30789d - #9764: exception message is wrong and misleading in findAccessorMethodName() of Magento\Framework\Reflection\NameFinder (reported by @dbsdsun) has been fixed in magento-engcom/magento2ce#1323 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 809ed03 2. de9d15a 3. b322c09 4. 703d9e0 5. ecfe901 6. a90dbca 7. b4a7213 8. 660c62a 9. 8d48fd3 10. d0b525b 11. 0dd84cd 12. 6746da4 13. 413f939 14. 2eca1d0 15. f9976b9 16. 4c77e4f 17. 6c62727 18. d891503 19. d10f55e 20. e2ff943 21. e27445d 22. f0711ed 23. 79de0d6 24. a30789d - #10474: Error message in product review form not being translated (reported by @Kivike) has been fixed in magento-engcom/magento2ce#1323 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 809ed03 2. de9d15a 3. b322c09 4. 703d9e0 5. ecfe901 6. a90dbca 7. b4a7213 8. 660c62a 9. 8d48fd3 10. d0b525b 11. 0dd84cd 12. 6746da4 13. 413f939 14. 2eca1d0 15. f9976b9 16. 4c77e4f 17. 6c62727 18. d891503 19. d10f55e 20. e2ff943 21. e27445d 22. f0711ed 23. 79de0d6 24. a30789d - #11329: Unable to proceed massaction "Update attributes" with required multiple select attribute (reported by @tcurilla) has been fixed in magento-engcom/magento2ce#1323 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 809ed03 2. de9d15a 3. b322c09 4. 703d9e0 5. ecfe901 6. a90dbca 7. b4a7213 8. 660c62a 9. 8d48fd3 10. d0b525b 11. 0dd84cd 12. 6746da4 13. 413f939 14. 2eca1d0 15. f9976b9 16. 4c77e4f 17. 6c62727 18. d891503 19. d10f55e 20. e2ff943 21. e27445d 22. f0711ed 23. 79de0d6 24. a30789d - #12083: Cannot import zero (0) value into custom attribute (reported by @gwilliams01) has been fixed in magento-engcom/magento2ce#1323 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 809ed03 2. de9d15a 3. b322c09 4. 703d9e0 5. ecfe901 6. a90dbca 7. b4a7213 8. 660c62a 9. 8d48fd3 10. d0b525b 11. 0dd84cd 12. 6746da4 13. 413f939 14. 2eca1d0 15. f9976b9 16. 4c77e4f 17. 6c62727 18. d891503 19. d10f55e 20. e2ff943 21. e27445d 22. f0711ed 23. 79de0d6 24. a30789d - #5188: Error generating URN-catalog when blank one exists (reported by @JamesonNetworks) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f - #6113: Validate range-words in Form component (UI Component) (reported by @robinhuy) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f - #9453: Reopened: '?SID' in URL even if disabled (reported by @hostep) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f - #11936: required attribute set id filter on attribute group repository getList (reported by @tzyganu) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f - #11953: Product configuration creator does not warn about invalid SKUs (reported by @JanisE) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f - #12715: Storefront Back to Sign in button does not work as expected (reported by @alena-marchenko) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f - #12719: Welcome message is shown with customer's first and last names after confirming account (reported by @alena-marchenko) has been fixed in magento-engcom/magento2ce#1298 by @magento-engcom-team in 2.3-develop branch Related commits: 1. 54301a8 2. 402b719 3. 3837f27 4. 031e23e 5. aa267f4 6. 934818d 7. 6bed7d4 8. 72b2794 9. 4e64c41 10. d3feb28 11. 7aeccea 12. b857c02 13. a75bf23 14. ab2e579 15. d904690 16. a821c7a 17. 68ac4c0 18. 93fe4d1 19. f43fd4b 20. 2c52a8f
2 parents bc111f5 + 16fe6b3 commit 81ace6a

File tree

46 files changed

+973
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+973
-227
lines changed

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ define([
9797
success: function (res) {
9898
var eventData, parameters;
9999

100-
$(document).trigger('ajax:addToCart', form.data().productSku);
100+
$(document).trigger('ajax:addToCart', form.data().productSku, form, res);
101101

102102
if (self.isLoaderEnabled()) {
103103
$('body').trigger(self.options.processStop);

app/code/Magento/CatalogImportExport/Model/Import/Product/Type/AbstractType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public function prepareAttributesWithDefaultValueForSave(array $rowData, $withDe
534534
public function clearEmptyData(array $rowData)
535535
{
536536
foreach ($this->_getProductAttributes($rowData) as $attrCode => $attrParams) {
537-
if (!$attrParams['is_static'] && empty($rowData[$attrCode])) {
537+
if (!$attrParams['is_static'] && !isset($rowData[$attrCode])) {
538538
unset($rowData[$attrCode]);
539539
}
540540
}

app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePanel.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\ConfigurableProduct\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Model\Product\Attribute\Backend\Sku;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
910
use Magento\Ui\Component\Container;
1011
use Magento\Ui\Component\Form;
@@ -466,7 +467,17 @@ protected function getRows()
466467
[],
467468
['dataScope' => 'product_link']
468469
),
469-
'sku_container' => $this->getColumn('sku', __('SKU')),
470+
'sku_container' => $this->getColumn(
471+
'sku',
472+
__('SKU'),
473+
[
474+
'validation' =>
475+
[
476+
'required-entry' => true,
477+
'max_text_length' => Sku::SKU_MAX_LENGTH,
478+
]
479+
]
480+
),
470481
'price_container' => $this->getColumn(
471482
'price',
472483
__('Price'),

app/code/Magento/Customer/Controller/Account/Confirmation.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
*/
77
namespace Magento\Customer\Controller\Account;
88

9+
use Magento\Customer\Model\Url;
910
use Magento\Framework\App\Action\Context;
1011
use Magento\Customer\Model\Session;
12+
use Magento\Framework\App\ObjectManager;
1113
use Magento\Framework\View\Result\PageFactory;
1214
use Magento\Store\Model\StoreManagerInterface;
1315
use Magento\Customer\Api\AccountManagementInterface;
@@ -35,24 +37,32 @@ class Confirmation extends \Magento\Customer\Controller\AbstractAccount
3537
*/
3638
protected $resultPageFactory;
3739

40+
/**
41+
* @var Url
42+
*/
43+
private $customerUrl;
44+
3845
/**
3946
* @param Context $context
4047
* @param Session $customerSession
4148
* @param PageFactory $resultPageFactory
4249
* @param StoreManagerInterface $storeManager
4350
* @param AccountManagementInterface $customerAccountManagement
51+
* @param Url $customerUrl
4452
*/
4553
public function __construct(
4654
Context $context,
4755
Session $customerSession,
4856
PageFactory $resultPageFactory,
4957
StoreManagerInterface $storeManager,
50-
AccountManagementInterface $customerAccountManagement
58+
AccountManagementInterface $customerAccountManagement,
59+
Url $customerUrl = null
5160
) {
5261
$this->session = $customerSession;
5362
$this->resultPageFactory = $resultPageFactory;
5463
$this->storeManager = $storeManager;
5564
$this->customerAccountManagement = $customerAccountManagement;
65+
$this->customerUrl = $customerUrl ?: ObjectManager::getInstance()->get(Url::class);
5666
parent::__construct($context);
5767
}
5868

@@ -98,6 +108,8 @@ public function execute()
98108
$resultPage = $this->resultPageFactory->create();
99109
$resultPage->getLayout()->getBlock('accountConfirmation')->setEmail(
100110
$this->getRequest()->getParam('email', $email)
111+
)->setLoginUrl(
112+
$this->customerUrl->getLoginUrl()
101113
);
102114
return $resultPage;
103115
}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Customer\Model;
7+
8+
use Magento\Store\Model\ScopeInterface;
9+
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\Framework\Registry;
11+
12+
/**
13+
* Class AccountConfirmation.
14+
* Checks if email confirmation required for customer.
15+
*/
16+
class AccountConfirmation
17+
{
18+
/**
19+
* Configuration path for email confirmation.
20+
*/
21+
const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm';
22+
23+
/**
24+
* @var ScopeConfigInterface
25+
*/
26+
private $scopeConfig;
27+
28+
/**
29+
* @var Registry
30+
*/
31+
private $registry;
32+
33+
/**
34+
* @param ScopeConfigInterface $scopeConfig
35+
* @param Registry $registry
36+
*/
37+
public function __construct(
38+
ScopeConfigInterface $scopeConfig,
39+
Registry $registry
40+
) {
41+
$this->scopeConfig = $scopeConfig;
42+
$this->registry = $registry;
43+
}
44+
45+
/**
46+
* Check if accounts confirmation is required.
47+
*
48+
* @param int|null $websiteId
49+
* @param int|null $customerId
50+
* @param string $customerEmail
51+
* @return bool
52+
*/
53+
public function isConfirmationRequired($websiteId, $customerId, $customerEmail): bool
54+
{
55+
if ($this->canSkipConfirmation($customerId, $customerEmail)) {
56+
return false;
57+
}
58+
59+
return (bool)$this->scopeConfig->getValue(
60+
self::XML_PATH_IS_CONFIRM,
61+
ScopeInterface::SCOPE_WEBSITES,
62+
$websiteId
63+
);
64+
}
65+
66+
/**
67+
* Check whether confirmation may be skipped when registering using certain email address.
68+
*
69+
* @param int|null $customerId
70+
* @param string $customerEmail
71+
* @return bool
72+
*/
73+
private function canSkipConfirmation($customerId, $customerEmail): bool
74+
{
75+
if (!$customerId) {
76+
return false;
77+
}
78+
79+
/* If an email was used to start the registration process and it is the same email as the one
80+
used to register, then this can skip confirmation.
81+
*/
82+
$skipConfirmationIfEmail = $this->registry->registry("skip_confirmation_if_email");
83+
if (!$skipConfirmationIfEmail) {
84+
return false;
85+
}
86+
87+
return strtolower($skipConfirmationIfEmail) === strtolower($customerEmail);
88+
}
89+
}

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ class AccountManagement implements AccountManagementInterface
8989
*/
9090
const XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity';
9191

92+
/**
93+
* @deprecated
94+
* @see AccountConfirmation::XML_PATH_IS_CONFIRM
95+
*/
9296
const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm';
9397

9498
/**
@@ -298,6 +302,11 @@ class AccountManagement implements AccountManagementInterface
298302
*/
299303
private $dateTimeFactory;
300304

305+
/**
306+
* @var AccountConfirmation
307+
*/
308+
private $accountConfirmation;
309+
301310
/**
302311
* @param CustomerFactory $customerFactory
303312
* @param ManagerInterface $eventManager
@@ -323,7 +332,8 @@ class AccountManagement implements AccountManagementInterface
323332
* @param ObjectFactory $objectFactory
324333
* @param ExtensibleDataObjectConverter $extensibleDataObjectConverter
325334
* @param CredentialsValidator|null $credentialsValidator
326-
* @param DateTimeFactory $dateTimeFactory
335+
* @param DateTimeFactory|null $dateTimeFactory
336+
* @param AccountConfirmation|null $accountConfirmation
327337
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
328338
*/
329339
public function __construct(
@@ -351,7 +361,8 @@ public function __construct(
351361
ObjectFactory $objectFactory,
352362
ExtensibleDataObjectConverter $extensibleDataObjectConverter,
353363
CredentialsValidator $credentialsValidator = null,
354-
DateTimeFactory $dateTimeFactory = null
364+
DateTimeFactory $dateTimeFactory = null,
365+
AccountConfirmation $accountConfirmation = null
355366
) {
356367
$this->customerFactory = $customerFactory;
357368
$this->eventManager = $eventManager;
@@ -379,6 +390,8 @@ public function __construct(
379390
$this->credentialsValidator =
380391
$credentialsValidator ?: ObjectManager::getInstance()->get(CredentialsValidator::class);
381392
$this->dateTimeFactory = $dateTimeFactory ?: ObjectManager::getInstance()->get(DateTimeFactory::class);
393+
$this->accountConfirmation = $accountConfirmation ?: ObjectManager::getInstance()
394+
->get(AccountConfirmation::class);
382395
}
383396

384397
/**
@@ -1161,17 +1174,15 @@ protected function sendEmailTemplate(
11611174
*
11621175
* @param CustomerInterface $customer
11631176
* @return bool
1177+
* @deprecated
1178+
* @see AccountConfirmation::isConfirmationRequired
11641179
*/
11651180
protected function isConfirmationRequired($customer)
11661181
{
1167-
if ($this->canSkipConfirmation($customer)) {
1168-
return false;
1169-
}
1170-
1171-
return (bool)$this->scopeConfig->getValue(
1172-
self::XML_PATH_IS_CONFIRM,
1173-
ScopeInterface::SCOPE_WEBSITES,
1174-
$customer->getWebsiteId()
1182+
return $this->accountConfirmation->isConfirmationRequired(
1183+
$customer->getWebsiteId(),
1184+
$customer->getId(),
1185+
$customer->getEmail()
11751186
);
11761187
}
11771188

@@ -1180,6 +1191,8 @@ protected function isConfirmationRequired($customer)
11801191
*
11811192
* @param CustomerInterface $customer
11821193
* @return bool
1194+
* @deprecated
1195+
* @see AccountConfirmation::isConfirmationRequired
11831196
*/
11841197
protected function canSkipConfirmation($customer)
11851198
{

app/code/Magento/Customer/Model/Customer.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Magento\Framework\Indexer\StateInterface;
1919
use Magento\Framework\Reflection\DataObjectProcessor;
2020
use Magento\Store\Model\ScopeInterface;
21+
use Magento\Framework\App\ObjectManager;
2122

2223
/**
2324
* Customer model
@@ -58,6 +59,10 @@ class Customer extends \Magento\Framework\Model\AbstractModel
5859

5960
const XML_PATH_RESET_PASSWORD_TEMPLATE = 'customer/password/reset_password_template';
6061

62+
/**
63+
* @deprecated
64+
* @see AccountConfirmation::XML_PATH_IS_CONFIRM
65+
*/
6166
const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm';
6267

6368
const XML_PATH_CONFIRM_EMAIL_TEMPLATE = 'customer/create_account/email_confirmation_template';
@@ -208,6 +213,11 @@ class Customer extends \Magento\Framework\Model\AbstractModel
208213
*/
209214
protected $indexerRegistry;
210215

216+
/**
217+
* @var AccountConfirmation
218+
*/
219+
private $accountConfirmation;
220+
211221
/**
212222
* @param \Magento\Framework\Model\Context $context
213223
* @param \Magento\Framework\Registry $registry
@@ -229,6 +239,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel
229239
* @param \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry
230240
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
231241
* @param array $data
242+
* @param AccountConfirmation|null $accountConfirmation
232243
*
233244
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
234245
*/
@@ -252,7 +263,8 @@ public function __construct(
252263
\Magento\Customer\Api\CustomerMetadataInterface $metadataService,
253264
\Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
254265
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
255-
array $data = []
266+
array $data = [],
267+
AccountConfirmation $accountConfirmation = null
256268
) {
257269
$this->metadataService = $metadataService;
258270
$this->_scopeConfig = $scopeConfig;
@@ -269,6 +281,8 @@ public function __construct(
269281
$this->dataObjectProcessor = $dataObjectProcessor;
270282
$this->dataObjectHelper = $dataObjectHelper;
271283
$this->indexerRegistry = $indexerRegistry;
284+
$this->accountConfirmation = $accountConfirmation ?: ObjectManager::getInstance()
285+
->get(AccountConfirmation::class);
272286
parent::__construct(
273287
$context,
274288
$registry,
@@ -770,20 +784,14 @@ public function sendNewAccountEmail($type = 'registered', $backUrl = '', $storeI
770784
* Check if accounts confirmation is required in config
771785
*
772786
* @return bool
787+
* @deprecated
788+
* @see AccountConfirmation::isConfirmationRequired
773789
*/
774790
public function isConfirmationRequired()
775791
{
776-
if ($this->canSkipConfirmation()) {
777-
return false;
778-
}
779-
780792
$websiteId = $this->getWebsiteId() ? $this->getWebsiteId() : null;
781793

782-
return (bool)$this->_scopeConfig->getValue(
783-
self::XML_PATH_IS_CONFIRM,
784-
ScopeInterface::SCOPE_WEBSITES,
785-
$websiteId
786-
);
794+
return $this->accountConfirmation->isConfirmationRequired($websiteId, $this->getId(), $this->getEmail());
787795
}
788796

789797
/**
@@ -1156,6 +1164,8 @@ public function setIsReadonly($value)
11561164
* Check whether confirmation may be skipped when registering using certain email address
11571165
*
11581166
* @return bool
1167+
* @deprecated
1168+
* @see AccountConfirmation::isConfirmationRequired
11591169
*/
11601170
protected function canSkipConfirmation()
11611171
{

0 commit comments

Comments
 (0)