Skip to content

Commit 1912fb7

Browse files
author
nebolsin
committed
fix for error in createLink() without 'controller' parameter
git-svn-id: https://svn.codehaus.org/grails/trunk@3972 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent 24cedbc commit 1912fb7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/grails/grails-app/taglib/ApplicationTagLib.groovy

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ class ApplicationTagLib {
8383
attrs = attrs.remove('url')
8484
}
8585

86-
def controller = attrs.remove("controller")
86+
def controller = attrs.contains("controller") ? attrs.remove("controller") : grailsAttributes.getController(request).controllerName
8787
def action = attrs.remove("action")
8888
def params = attrs.params ? attrs.remove('params') : [:]
89-
def mapping = grailsUrlMappingsHolder?.getReverseMapping(controller,
89+
90+
def mapping = grailsUrlMappingsHolder?.getReverseMapping(controller,
9091
action,
9192
params)
9293
def url
@@ -103,13 +104,7 @@ class ApplicationTagLib {
103104
out << url
104105
}
105106
else {
106-
// if the current attribute null set the controller uri to the current controller
107-
if(controller) {
108-
out << '/' << controller
109-
}
110-
else {
111-
out << grailsAttributes.getControllerUri(request)
112-
}
107+
out << '/' << controller
113108
if(action) {
114109
out << '/' << action
115110
}

0 commit comments

Comments
 (0)