| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Grails
Revision: 7243
Author: graeme
Date: 22 Jul 2008 17:43:30
Changes:fix for GRAILS-3269 and GRAILS-3268
Files:| ... | ...@@ -141,12 +141,6 @@ | |
| 141 | 141 | def link = { attrs, body -> |
| 142 | 142 | def writer = out |
| 143 | 143 | writer << '<a href="' |
| 144 | // create the link | |
| 145 | if(request['flowExecutionKey']) { | |
| 146 | if(!attrs.params) attrs.params = [:] | |
| 147 | attrs.params."_flowExecutionKey" = request['flowExecutionKey'] | |
| 148 | } | |
| 149 | ||
| 150 | 144 | writer << createLink(attrs).encodeAsHTML() |
| 151 | 145 | writer << '"' |
| 152 | 146 | // process remaining attributes |
| ... | ...@@ -194,8 +188,12 @@ | |
| 194 | 188 | def frag = urlAttrs.remove('fragment') |
| 195 | 189 | def params = urlAttrs.params && urlAttrs.params instanceof Map ? urlAttrs.remove('params') : [:] |
| 196 | 190 | |
| 191 | if(request['flowExecutionKey']) { | |
| 192 | params."_flowExecutionKey" = request['flowExecutionKey'] | |
| 193 | } | |
| 194 | ||
| 197 | 195 | if(urlAttrs.event) { |
| 198 | params."_eventId" = urlAttrs.event | |
| 196 | params."_eventId" = urlAttrs.remove('event') | |
| 199 | 197 | } |
| 200 | 198 | def url |
| 201 | 199 | if(id != null) params.id = id |
| ... | ...@@ -51,6 +51,25 @@ | |
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | void testCreateLinkWithFlowExecutionKeyAndEvent() { | |
| 55 | request.flowExecutionKey = '12345' | |
| 56 | ||
| 57 | def template = '<g:createLink controller="foo" action="bar" event="boo" />' | |
| 58 | ||
| 59 | assertOutputEquals('/foo/bar?_flowExecutionKey=12345&_eventId=boo', template) | |
| 60 | ||
| 61 | } | |
| 62 | ||
| 63 | void testLinkWithFlowExecutionKeyAndEvent() { | |
| 64 | request.flowExecutionKey = '12345' | |
| 65 | ||
| 66 | def template = '<g:link controller="foo" action="bar" event="boo" >link</g:link>' | |
| 67 | ||
| 68 | assertOutputEquals('<a href="/foo/bar?_flowExecutionKey=12345&_eventId=boo">link</a>', template) | |
| 69 | ||
| 70 | } | |
| 71 | ||
| 72 | ||
| 54 | 73 | void testSetTag() { |
| 55 | 74 | def template = '<g:set var="one" value="two" />one: ${one}' |
| 56 | 75 |