Skip to content

Commit

Permalink
[playframework#388] Fix Router.reverse(action).add(x,y)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumebort committed Dec 21, 2010
1 parent e368f09 commit df6faee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions framework/src/play/mvc/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,12 @@ public static ActionDefinition reverse(String action, Map<String, Object> args)
if (action.startsWith("controllers.")) {
action = action.substring(12);
}
Map<String, Object> argsbackup = args;
Map<String, Object> argsbackup = new HashMap<String, Object>(args);
// Add routeArgs
if (Scope.RouteArgs.current() != null) {
argsbackup.putAll(Scope.RouteArgs.current().data);
args.putAll(Scope.RouteArgs.current().data);
}
for (Route route : routes) {
args = new HashMap<String, Object>(argsbackup);
if (route.actionPattern != null) {
Matcher matcher = route.actionPattern.matcher(action);
if (matcher.matches()) {
Expand Down Expand Up @@ -518,7 +517,7 @@ public static ActionDefinition reverse(String action, Map<String, Object> args)
actionDefinition.method = route.method == null || route.method.equals("*") ? "GET" : route.method.toUpperCase();
actionDefinition.star = "*".equals(route.method);
actionDefinition.action = action;
actionDefinition.args = args;
actionDefinition.args = argsbackup;
actionDefinition.host = host;
return actionDefinition;
}
Expand Down

0 comments on commit df6faee

Please sign in to comment.