Skip to content

Commit 27207cf

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.2-develop
Accepted Community Pull Requests: - #22895: [Backport] #22869 - defaulting customer storeId fix (by @Wirson) Fixed GitHub Issues: - #22869: REST: Updating a customer without store_id sets the store_id to default (reported by @808brinks) has been fixed in #22895 by @Wirson in 2.2-develop branch Related commits: 1. 9fd7722 2. f84f0db
2 parents 66e4e96 + 8c3a54d commit 27207cf

File tree

2 files changed

+57
-189
lines changed

2 files changed

+57
-189
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa
214214

215215
$storeId = $customerModel->getStoreId();
216216
if ($storeId === null) {
217-
$customerModel->setStoreId($this->storeManager->getStore()->getId());
217+
$customerModel->setStoreId(
218+
$prevCustomerData ? $prevCustomerData->getStoreId() : $this->storeManager->getStore()->getId()
219+
);
218220
}
219221

220222
$this->populateCustomerWithSecureData($customerModel, $passwordHash);

0 commit comments

Comments
 (0)