Permalink
Browse files

Fix chaining to namespaced controllers

Fixes grails/grails-core#9076.

Functional tests at
grails/grails-functional-tests@f3d8491
ae808e05f8e940f95c657ca5c.
  • Loading branch information...
1 parent 1d32278 commit 1e174b352086021eed6a19b2732a7688a5d81015 @jeffbrown jeffbrown committed Jul 3, 2015
@@ -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 ?: [:]
@@ -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")
@@ -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) {

0 comments on commit 1e174b3

Please sign in to comment.