Skip to content

Commit 8694e0b

Browse files
authored
magento2-login-as-customer/issues/134: Login as Customer not working if store view code is added to url.
2 parents d5621d5 + 1a72ffb commit 8694e0b

File tree

1 file changed

+7
-4
lines changed
  • app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login

1 file changed

+7
-4
lines changed

app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,13 @@ public function execute(): ResultInterface
146146
return $resultRedirect->setPath('customer/index/index');
147147
}
148148

149-
$storeId = (int)$this->_request->getParam('store_id');
150-
if (empty($storeId) && $this->config->isStoreManualChoiceEnabled()) {
151-
$this->messageManager->addNoticeMessage(__('Please select a Store View to login in.'));
152-
return $resultRedirect->setPath('customer/index/edit', ['id' => $customerId]);
149+
$storeId = null;
150+
if ($this->config->isStoreManualChoiceEnabled()) {
151+
$storeId = (int)$this->_request->getParam('store_id');
152+
if (empty($storeId)) {
153+
$this->messageManager->addNoticeMessage(__('Please select a Store View to login in.'));
154+
return $resultRedirect->setPath('customer/index/edit', ['id' => $customerId]);
155+
}
153156
}
154157

155158
$adminUser = $this->authSession->getUser();

0 commit comments

Comments
 (0)