File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
app/code/Magento/Backend/Model
dev/tests/integration/testsuite/Magento/Backend/Model Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,9 @@ public function getUrl($routePath = null, $routeParams = null)
198
198
return $ result ;
199
199
}
200
200
201
+ $ this ->getRouteParamsResolver ()->unsetData ('route_params ' );
201
202
$ this ->_setRoutePath ($ routePath );
203
+ $ extraParams = $ this ->getRouteParamsResolver ()->getRouteParams ();
202
204
$ routeName = $ this ->_getRouteName ('* ' );
203
205
$ controllerName = $ this ->_getControllerName (self ::DEFAULT_CONTROLLER_NAME );
204
206
$ actionName = $ this ->_getActionName (self ::DEFAULT_ACTION_NAME );
@@ -213,8 +215,8 @@ public function getUrl($routePath = null, $routeParams = null)
213
215
$ routeParams [self ::SECRET_KEY_PARAM_NAME ] = $ secretKey ;
214
216
}
215
217
216
- if (is_array ( $ this -> _getRouteParams () )) {
217
- $ routeParams = array_merge ($ this -> _getRouteParams () , $ routeParams );
218
+ if (! empty ( $ extraParams )) {
219
+ $ routeParams = array_merge ($ extraParams , $ routeParams );
218
220
}
219
221
220
222
return parent ::getUrl ("{$ routeName }/ {$ controllerName }/ {$ actionName }" , $ routeParams );
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ public function testGetUrl()
75
75
];
76
76
$ url = $ this ->_model ->getUrl ('path ' , $ routeParams );
77
77
$ this ->assertContains ('/param4/ ' . $ paramEncoder ->encode ('a4== ' ) . '/ ' , $ url );
78
+
79
+ $ url = $ this ->_model ->getUrl ('route/controller/action/id/100 ' );
80
+ $ this ->assertContains ('id/100 ' , $ url );
78
81
}
79
82
80
83
/**
You can’t perform that action at this time.
0 commit comments