From c7fc5dbb7dc55d2038678f7f50efa47a4532c066 Mon Sep 17 00:00:00 2001 From: Ryan Hoerr Date: Fri, 1 Nov 2024 11:27:31 -0400 Subject: [PATCH] fix merge issues from applying 2.4.7-p3 patch (#111) --- .../Customer/Model/Plugin/UpdateCustomer.php | 2 +- .../Model/Customer/ValidateCustomerData.php | 70 +++++++++++++++++++ app/code/Magento/Integration/i18n/en_US.csv | 1 - app/code/Magento/Quote/i18n/en_US.csv | 2 - .../adminhtml/Magento/backend/i18n/en_US.csv | 1 - .../frontend/Magento/blank/i18n/en_US.csv | 2 - 6 files changed, 71 insertions(+), 7 deletions(-) create mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php diff --git a/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php b/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php index 1436453a88fb..28b9bd5cc651 100644 --- a/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php +++ b/app/code/Magento/Customer/Model/Plugin/UpdateCustomer.php @@ -64,7 +64,7 @@ public function beforeSave( ) { $customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer); } elseif ($customerId && in_array($userType, [UserContextInterface::USER_TYPE_ADMIN, - UserContextInterface::USER_TYPE_INTEGRATION], true) + UserContextInterface::USER_TYPE_INTEGRATION], true) ) { $customer = $this->getUpdatedCustomer($customerRepository->getById($customerId), $customer); } diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php new file mode 100644 index 000000000000..95d68d69d71e --- /dev/null +++ b/app/code/Magento/CustomerGraphQl/Model/Customer/ValidateCustomerData.php @@ -0,0 +1,70 @@ +getAllowedCustomerAttributes = $getAllowedCustomerAttributes; + $this->emailAddressValidator = $emailAddressValidator; + $this->validators = $validators; + } + + /** + * Validate customer data + * + * @param array $customerData + * @throws GraphQlInputException + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function execute(array $customerData) + { + /** @var ValidateCustomerDataInterface $validator */ + foreach ($this->validators as $validator) { + $validator->execute($customerData); + } + } +} diff --git a/app/code/Magento/Integration/i18n/en_US.csv b/app/code/Magento/Integration/i18n/en_US.csv index 14311ac0e219..e26d36157ff0 100644 --- a/app/code/Magento/Integration/i18n/en_US.csv +++ b/app/code/Magento/Integration/i18n/en_US.csv @@ -126,4 +126,3 @@ OAuth,OAuth "We couldn't find any records.","We couldn't find any records." Status,Status "Invalid Identity Link URL", "Invalid Identity Link URL" -"Invalid Identity Link URL", "Invalid Identity Link URL" diff --git a/app/code/Magento/Quote/i18n/en_US.csv b/app/code/Magento/Quote/i18n/en_US.csv index 9ec0f34f240d..6563651ba5ac 100644 --- a/app/code/Magento/Quote/i18n/en_US.csv +++ b/app/code/Magento/Quote/i18n/en_US.csv @@ -75,5 +75,3 @@ Carts,Carts "Identity type not found","Identity type not found" "Invalid order backpressure limit config","Invalid order backpressure limit config" "Please check input parameters.","Please check input parameters." -"Please check input parameters.","Please check input parameters." -"Please check input parameters.","Please check input parameters." diff --git a/app/design/adminhtml/Magento/backend/i18n/en_US.csv b/app/design/adminhtml/Magento/backend/i18n/en_US.csv index 93b02266ccb7..94c02198a631 100644 --- a/app/design/adminhtml/Magento/backend/i18n/en_US.csv +++ b/app/design/adminhtml/Magento/backend/i18n/en_US.csv @@ -550,4 +550,3 @@ Dashboard,Dashboard "Invalid data type","Invalid data type" "Invalid value provided for attribute %1","Invalid value provided for attribute %1" "Invalid data type","Invalid data type" -"Invalid data type","Invalid data type" diff --git a/app/design/frontend/Magento/blank/i18n/en_US.csv b/app/design/frontend/Magento/blank/i18n/en_US.csv index 45dcf4f12556..cc02ab5ac902 100644 --- a/app/design/frontend/Magento/blank/i18n/en_US.csv +++ b/app/design/frontend/Magento/blank/i18n/en_US.csv @@ -440,5 +440,3 @@ Test,Test test,test Two,Two "Invalid data type","Invalid data type" -"Invalid data type","Invalid data type" -"Invalid data type","Invalid data type"