Skip to content

Commit

Permalink
Fix chaining to namespaced controllers
Browse files Browse the repository at this point in the history
Fixes #9076.

Functional tests at
grails/grails-functional-tests@f3d84911767f622
ae808e05f8e940f95c657ca5c.
  • Loading branch information
Jeff Scott Brown committed Jul 3, 2015
1 parent 1d32278 commit 1e174b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ChainMethod {
def controller = args.controller ?: GrailsNameUtils.getLogicalPropertyName(
target.getClass().name, ControllerArtefactHandler.TYPE)
def action = args.action
def namespace = args.remove('namespace')
def plugin = args.remove('plugin')
def id = args.id
def params = args.params ?: [:]
Expand Down Expand Up @@ -75,10 +76,10 @@ class ChainMethod {
// the reverse URL mapping.
if (id) params.id = id

UrlCreator creator = mappings.getReverseMapping(controller, action, plugin, params)
UrlCreator creator = mappings.getReverseMapping(controller, action, namespace, plugin, params)
def response = webRequest.getCurrentResponse()

String url = creator.createURL(controller, action, plugin, params, 'utf-8')
String url = creator.createURL(controller, action, namespace, plugin, params, 'utf-8')

if (appCtx.containsBean("requestDataValueProcessor")) {
RequestDataValueProcessor valueProcessor = appCtx.getBean("requestDataValueProcessor")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ private void populateParameterList(Map paramValues, String encoding, StringBuild
boolean addedParams = false;
usedParams.add("controller");
usedParams.add("action");
usedParams.add("namespace");

// A 'null' encoding will cause an exception, so default to 'UTF-8'.
if (encoding == null) {
Expand Down

0 comments on commit 1e174b3

Please sign in to comment.