Skip to content

Commit 9146fb8

Browse files
authored
Merge pull request #3924 from skoeva/createrouteurl
frontend: createRouteURL: Accept paths for route names
2 parents 827e135 + 6a5f43f commit 9146fb8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

frontend/src/lib/router/createRouteURL.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ export function createRouteURL(routeName: string, params: RouteURLProps = {}) {
7676
const route = matchingStoredRouteByName || matchingStoredRouteByPath || getRoute(routeName);
7777

7878
if (!route) {
79+
// Backward compatibility: some plugins call createRouteURL with a
80+
// path template instead of a registered route name. This serves
81+
// as a temporary fix to avoid breaking those plugins.
82+
//
83+
// @todo: Merge the plugin routes into the main store.
84+
if (routeName.startsWith('/')) {
85+
return generatePath(routeName, params);
86+
}
7987
return '';
8088
}
8189

0 commit comments

Comments
 (0)