-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed 24990: link doesn't redirect to dashboard #26100
Changes from 1 commit
5a5091c
1818eaf
c98e03f
8c672eb
b90f20c
531a22f
4336cf1
f39a494
31bbf07
e1b0ff0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,14 @@ | |
*/ | ||
namespace Magento\Setup\Controller; | ||
|
||
use Magento\Backend\Model\UrlInterface; | ||
use Magento\Setup\Exception; | ||
use Magento\Setup\Model\Cron\Status; | ||
use Magento\Setup\Model\Navigation as NavModel; | ||
use Magento\Setup\Model\ObjectManagerProvider; | ||
use Zend\Mvc\Controller\AbstractActionController; | ||
use Zend\View\Model\JsonModel; | ||
use Zend\View\Model\ViewModel; | ||
use Magento\Setup\Model\Cron\Status; | ||
use Magento\Setup\Model\ObjectManagerProvider; | ||
|
||
/** | ||
* Class Navigation | ||
|
@@ -47,7 +49,7 @@ public function __construct(NavModel $navigation, Status $status, ObjectManagerP | |
$this->navigation = $navigation; | ||
$this->status = $status; | ||
$this->objectManagerProvider = $objectManagerProvider; | ||
$this->view = new ViewModel; | ||
$this->view = new ViewModel(); | ||
$this->view->setVariable('menu', $this->navigation->getMenuItems()); | ||
$this->view->setVariable('main', $this->navigation->getMainItems()); | ||
} | ||
|
@@ -57,7 +59,7 @@ public function __construct(NavModel $navigation, Status $status, ObjectManagerP | |
*/ | ||
public function indexAction() | ||
{ | ||
$json = new JsonModel; | ||
$json = new JsonModel(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you instantiating classes with |
||
$json->setVariable('nav', $this->navigation->getData()); | ||
$json->setVariable('menu', $this->navigation->getMenuItems()); | ||
$json->setVariable('main', $this->navigation->getMainItems()); | ||
|
@@ -79,11 +81,12 @@ public function menuAction() | |
|
||
/** | ||
* @return array|ViewModel | ||
* @throws Exception | ||
*/ | ||
public function sideMenuAction() | ||
{ | ||
/** @var \Magento\Backend\Model\UrlInterface $backendUrl */ | ||
$backendUrl = $this->objectManagerProvider->get()->get(\Magento\Backend\Model\UrlInterface::class); | ||
/** @var UrlInterface $backendUrl */ | ||
$backendUrl = $this->objectManagerProvider->get()->get(UrlInterface::class); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should inject that class to the constructor. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @lbajsarowicz , Also I want to notice that construction like this If such approach is wrong, maybe You could advise me something ? Thanks a lot! |
||
|
||
$this->view->setTemplate('/magento/setup/navigation/side-menu.phtml'); | ||
$this->view->setVariable('isInstaller', $this->navigation->getType() == NavModel::NAV_INSTALLER); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you instantiating classes with
new
instead of usingFactory
or just Dependency Injection?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot create through Factory or Dependency Injection as usual I am getting such error
Also I see a lot of cases in
setup/src/Magento/Setup/Controller
were these object was created withnew