Skip to content

Commit 8c3a54d

Browse files
authored
ENGCOM-5188: [Backport] #22869 - defaulting customer storeId fix #22895
2 parents 66e4e96 + d078e5c commit 8c3a54d

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)