Skip to content

Commit f22ab3c

Browse files
committed
#22869 - defaulting customer storeId fix
1 parent 02bca98 commit f22ab3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function save(CustomerInterface $customer, $passwordHash = null)
209209
$customerModel->setId($customer->getId());
210210
$storeId = $customerModel->getStoreId();
211211
if ($storeId === null) {
212-
$customerModel->setStoreId($this->storeManager->getStore()->getId());
212+
$customerModel->setStoreId($prevCustomerData->getStoreId() ?? $this->storeManager->getStore()->getId());
213213
}
214214
// Need to use attribute set or future updates can cause data loss
215215
if (!$customerModel->getAttributeSetId()) {

0 commit comments

Comments
 (0)