spock icon indicating copy to clipboard operation
spock copied to clipboard

Add spring7 tests

Open Vampire opened this issue 1 month ago • 4 comments

Vampire avatar Nov 14 '25 01:11 Vampire

The bug must have been introduced in Grails 6.1.2 and it seems to also be present in Grails 7.0.0 ...

dauer avatar Oct 27 '25 15:10 dauer

Hi, In your code, you forget absolute:false.

The bug introduced between grails 5.2X (https://github.com/apache/grails-core/blob/5.2.x/grails-web-url-mappings/src/main/groovy/grails/web/mapping/ResponseRedirector.groovy#L125) and grails 5.3.X (https://github.com/apache/grails-core/blob/5.3.x/grails-web-url-mappings/src/main/groovy/grails/web/mapping/ResponseRedirector.groovy#L125)

Noirtam avatar Nov 12 '25 15:11 Noirtam

Probably a dumb question, but may I ask the use case for first creating a url with the LinkGenerator and then passing that url to redirect() (where the LinkGenerator will be invoked again) instead of calling redirect() directly?

From the example application provided: https://github.com/imranmir/redirect-issue

class TestController {

    LinkGenerator grailsLinkGenerator

    def index() {
        def url = grailsLinkGenerator.link(controller: 'menu', action: 'home')
        redirect(url: url)
   }

    // vs

    def index2() {
        redirect(controller: 'menu', action: 'home')
    }
}

matrei avatar Nov 13 '25 16:11 matrei

The linkGenerator.link call comes from a legacy helper method that’s responsible for generating links dynamically. Redirecting with that link is just one of the things it does — the same link is also passed to JavaScript and used in a few other places. So we end up reusing that generated link in redirect() instead of calling redirect() directly.

imranmir avatar Nov 18 '25 05:11 imranmir

Fixed by https://github.com/apache/grails-core/pull/15227

jdaugherty avatar Nov 19 '25 15:11 jdaugherty

Reverts changes for https://github.com/apache/grails-core/issues/11673

jdaugherty avatar Nov 19 '25 15:11 jdaugherty