Skip to content

Commit 2189982

Browse files
committed
ACP2E-2791: Not able to Save Customer attribute information in Admin Edit customer section;
1 parent 0cc7bfe commit 2189982

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

app/code/Magento/Customer/Model/SetCustomerStore.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,17 @@ public function __construct(private StoreManagerInterface $storeManager)
3939
*/
4040
public function setStore(array|null $requestData = null): void
4141
{
42-
$storeId = $requestData[CustomerInterface::STORE_ID] ?? null;
42+
$websiteId = $requestData[CustomerInterface::WEBSITE_ID] ?? null;
43+
try {
44+
$website = $this->storeManager->getWebsite($websiteId);
45+
$storeId = $website ? current($website->getStoreIds()) : null;
46+
} catch (LocalizedException $e) {
47+
$storeId = null;
48+
}
4349
if (!$storeId) {
44-
$websiteId = $requestData[CustomerInterface::WEBSITE_ID] ?? null;
45-
try {
46-
$website = $this->storeManager->getWebsite($websiteId);
47-
$storeId = $website ? current($website->getStoreIds()) : null;
48-
} catch (LocalizedException $e) {
49-
$storeId = null;
50-
}
50+
$storeId = $requestData[CustomerInterface::STORE_ID] ?? null;
5151
}
52+
5253
$this->storeManager->setCurrentStore($storeId);
5354
}
5455
}

0 commit comments

Comments
 (0)