Skip to content

Commit b61adb8

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-89066' into 2.1.13-develop-pr48
2 parents 0455635 + 23cb416 commit b61adb8

File tree

2 files changed

+9
-0
lines changed
  • app/code/Magento/Backend/Model
  • dev/tests/integration/testsuite/Magento/Backend/Model

2 files changed

+9
-0
lines changed

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

Lines changed: 6 additions & 0 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,6 +215,10 @@ public function getUrl($routePath = null, $routeParams = null)
213215
$routeParams[self::SECRET_KEY_PARAM_NAME] = $secretKey;
214216
}
215217

218+
if (!empty($extraParams)) {
219+
$routeParams = array_merge($extraParams, $routeParams);
220+
}
221+
216222
return parent::getUrl("{$routeName}/{$controllerName}/{$actionName}", $routeParams);
217223
}
218224

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)