Skip to content

Commit c7fc5db

Browse files
authored
fix merge issues from applying 2.4.7-p3 patch (#111)
1 parent 73295d6 commit c7fc5db

File tree

6 files changed

+71
-7
lines changed

6 files changed

+71
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function beforeSave(
6464
) {
6565
$customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer);
6666
} elseif ($customerId && in_array($userType, [UserContextInterface::USER_TYPE_ADMIN,
67-
UserContextInterface::USER_TYPE_INTEGRATION], true)
67+
UserContextInterface::USER_TYPE_INTEGRATION], true)
6868
) {
6969
$customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer);
7070
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\CustomerGraphQl\Model\Customer;
9+
10+
use Magento\CustomerGraphQl\Api\ValidateCustomerDataInterface;
11+
use Magento\Framework\Exception\LocalizedException;
12+
use Magento\Framework\Exception\NoSuchEntityException;
13+
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
14+
use Magento\Framework\Validator\EmailAddress as EmailAddressValidator;
15+
16+
/**
17+
* Customer data validation used during customer account creation and updating
18+
*/
19+
class ValidateCustomerData
20+
{
21+
/**
22+
* Get allowed/required customer attributes
23+
*
24+
* @var GetAllowedCustomerAttributes
25+
*/
26+
private $getAllowedCustomerAttributes;
27+
28+
/**
29+
* @var EmailAddressValidator
30+
*/
31+
private $emailAddressValidator;
32+
33+
/**
34+
* @var ValidateCustomerDataInterface[]
35+
*/
36+
private $validators = [];
37+
38+
/**
39+
* ValidateCustomerData constructor.
40+
*
41+
* @param GetAllowedCustomerAttributes $getAllowedCustomerAttributes
42+
* @param EmailAddressValidator $emailAddressValidator
43+
* @param array $validators
44+
*/
45+
public function __construct(
46+
GetAllowedCustomerAttributes $getAllowedCustomerAttributes,
47+
EmailAddressValidator $emailAddressValidator,
48+
$validators = []
49+
) {
50+
$this->getAllowedCustomerAttributes = $getAllowedCustomerAttributes;
51+
$this->emailAddressValidator = $emailAddressValidator;
52+
$this->validators = $validators;
53+
}
54+
55+
/**
56+
* Validate customer data
57+
*
58+
* @param array $customerData
59+
* @throws GraphQlInputException
60+
* @throws LocalizedException
61+
* @throws NoSuchEntityException
62+
*/
63+
public function execute(array $customerData)
64+
{
65+
/** @var ValidateCustomerDataInterface $validator */
66+
foreach ($this->validators as $validator) {
67+
$validator->execute($customerData);
68+
}
69+
}
70+
}

app/code/Magento/Integration/i18n/en_US.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,3 @@ OAuth,OAuth
126126
"We couldn't find any records.","We couldn't find any records."
127127
Status,Status
128128
"Invalid Identity Link URL", "Invalid Identity Link URL"
129-
"Invalid Identity Link URL", "Invalid Identity Link URL"

app/code/Magento/Quote/i18n/en_US.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,3 @@ Carts,Carts
7575
"Identity type not found","Identity type not found"
7676
"Invalid order backpressure limit config","Invalid order backpressure limit config"
7777
"Please check input parameters.","Please check input parameters."
78-
"Please check input parameters.","Please check input parameters."
79-
"Please check input parameters.","Please check input parameters."

app/design/adminhtml/Magento/backend/i18n/en_US.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,4 +550,3 @@ Dashboard,Dashboard
550550
"Invalid data type","Invalid data type"
551551
"Invalid value provided for attribute %1","Invalid value provided for attribute %1"
552552
"Invalid data type","Invalid data type"
553-
"Invalid data type","Invalid data type"

app/design/frontend/Magento/blank/i18n/en_US.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,5 +440,3 @@ Test,Test
440440
test,test
441441
Two,Two
442442
"Invalid data type","Invalid data type"
443-
"Invalid data type","Invalid data type"
444-
"Invalid data type","Invalid data type"

0 commit comments

Comments
 (0)