From 408f73e09e4c83208fa49c9e0556a2d1ced04ac4 Mon Sep 17 00:00:00 2001 From: Eugene Tulika Date: Mon, 18 May 2015 15:13:14 -0500 Subject: [PATCH] MAGETWO-37705: Exception in setup wizard after Magento is installed --- setup/src/Magento/Setup/Controller/Index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Controller/Index.php b/setup/src/Magento/Setup/Controller/Index.php index 979b8f82111c8..1c239ab77aaac 100644 --- a/setup/src/Magento/Setup/Controller/Index.php +++ b/setup/src/Magento/Setup/Controller/Index.php @@ -35,9 +35,16 @@ public function __construct( public function indexAction() { if ($this->objectManager->get('Magento\Framework\App\DeploymentConfig')->isAvailable()) { + /** @var \Magento\Framework\App\State $adminAppState */ + $adminAppState = $this->objectManager->get('Magento\Framework\App\State'); + $adminAppState->setAreaCode(\Magento\Framework\App\Area::AREA_ADMIN); + $this->objectManager->create( 'Magento\Backend\Model\Auth\Session', - ['sessionConfig' => $this->objectManager->get('Magento\Backend\Model\Session\AdminConfig')] + [ + 'sessionConfig' => $this->objectManager->get('Magento\Backend\Model\Session\AdminConfig'), + 'appState' => $adminAppState + ] ); if (!$this->objectManager->get('Magento\Backend\Model\Auth')->isLoggedIn()) { $view = new ViewModel();