Skip to content
This repository was archived by the owner on May 20, 2019. It is now read-only.

Commit 2662dfa

Browse files
committed
convert route name to route ID (#7557)
1 parent 03ab0fd commit 2662dfa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/code/Magento/Backend/Block/Menu.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,20 @@ class Menu extends \Magento\Backend\Block\Template
7474
*/
7575
private $anchorRenderer;
7676

77+
/**
78+
* @var \Magento\Framework\App\Route\ConfigInterface
79+
*/
80+
private $routeConfig;
81+
82+
7783
/**
7884
* @param Template\Context $context
7985
* @param \Magento\Backend\Model\UrlInterface $url
8086
* @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory
8187
* @param \Magento\Backend\Model\Auth\Session $authSession
8288
* @param \Magento\Backend\Model\Menu\Config $menuConfig
8389
* @param \Magento\Framework\Locale\ResolverInterface $localeResolver
90+
* @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
8491
* @param array $data
8592
* @param MenuItemChecker|null $menuItemChecker
8693
* @param AnchorRenderer|null $anchorRenderer
@@ -92,6 +99,7 @@ public function __construct(
9299
\Magento\Backend\Model\Auth\Session $authSession,
93100
\Magento\Backend\Model\Menu\Config $menuConfig,
94101
\Magento\Framework\Locale\ResolverInterface $localeResolver,
102+
\Magento\Framework\App\Route\ConfigInterface $routeConfig,
95103
array $data = [],
96104
MenuItemChecker $menuItemChecker = null,
97105
AnchorRenderer $anchorRenderer = null
@@ -104,6 +112,7 @@ public function __construct(
104112
$this->menuItemChecker = $menuItemChecker;
105113
$this->anchorRenderer = $anchorRenderer;
106114
parent::__construct($context, $data);
115+
$this->routeConfig = $routeConfig;
107116
}
108117

109118
/**
@@ -203,8 +212,9 @@ protected function _afterToHtml($html)
203212
*/
204213
protected function _callbackSecretKey($match)
205214
{
215+
$routeId = $this->routeConfig->getRouteByFrontName($match[1]);
206216
return \Magento\Backend\Model\UrlInterface::SECRET_KEY_PARAM_NAME . '/' . $this->_url->getSecretKey(
207-
$match[1],
217+
$routeId,
208218
$match[2],
209219
$match[3]
210220
);

0 commit comments

Comments
 (0)