Skip to content

Commit 23cb416

Browse files
committed
MAGETWO-89066: Category chooser shows blank block
1 parent 8c3f482 commit 23cb416

File tree

2 files changed

+7
-2
lines changed
  • app/code/Magento/Backend/Model
  • dev/tests/integration/testsuite/Magento/Backend/Model

2 files changed

+7
-2
lines changed

app/code/Magento/Backend/Model/Url.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ public function getUrl($routePath = null, $routeParams = null)
198198
return $result;
199199
}
200200

201+
$this->getRouteParamsResolver()->unsetData('route_params');
201202
$this->_setRoutePath($routePath);
203+
$extraParams = $this->getRouteParamsResolver()->getRouteParams();
202204
$routeName = $this->_getRouteName('*');
203205
$controllerName = $this->_getControllerName(self::DEFAULT_CONTROLLER_NAME);
204206
$actionName = $this->_getActionName(self::DEFAULT_ACTION_NAME);
@@ -213,8 +215,8 @@ public function getUrl($routePath = null, $routeParams = null)
213215
$routeParams[self::SECRET_KEY_PARAM_NAME] = $secretKey;
214216
}
215217

216-
if (is_array($this->_getRouteParams())) {
217-
$routeParams = array_merge($this->_getRouteParams(), $routeParams);
218+
if (!empty($extraParams)) {
219+
$routeParams = array_merge($extraParams, $routeParams);
218220
}
219221

220222
return parent::getUrl("{$routeName}/{$controllerName}/{$actionName}", $routeParams);

dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public function testGetUrl()
7575
];
7676
$url = $this->_model->getUrl('path', $routeParams);
7777
$this->assertContains('/param4/' . $paramEncoder->encode('a4==') . '/', $url);
78+
79+
$url = $this->_model->getUrl('route/controller/action/id/100');
80+
$this->assertContains('id/100', $url);
7881
}
7982

8083
/**

0 commit comments

Comments
 (0)