Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g:sortableColumn generates wrong links when used with a controller with a specific mapping #44

Closed
fuxx opened this issue Jul 17, 2019 · 1 comment

Comments

@fuxx
Copy link
Contributor

fuxx commented Jul 17, 2019

Hej!

The issue is known since 2017 and was not merged because of a missing test.
I create a pull-request with the required tests as requested in the original pull request made to grails core grails/grails-core#10839.

Original issue: grails/grails-core#10819
Related issue:

the issue was reported before, but was closed because the issue was not described properly.

Fortunately it is very straightforward ...

Steps to Reproduce

  1. Create a controller with a mapping like this: "/somepath/mycontroller/$action?/$id?" controller: 'mycontroller'
  2. use sortable column tag on a GSP rendered by mycontroller: <g:sortableColumn property="prop" title="Title"/>

Expected Behaviour

The generated link should be "/somepath/mycontroller/index?sort=...".

Actual Behaviour

The link misses the "/somepath" part. Wrong URL: "/mycontroller/index?sort=...".

Environment Information

  • Grails Version: 3.3.0
  • JDK Version: 8

Fix

As described here, replace def namespace = attrs.namespace ? attrs.remove("namespace") : "" with def namespace = attrs.remove("namespace") in org.grails.plugins.web.taglib.UrlMappingTagLib#sortableColumn

@fuxx
Copy link
Contributor Author

fuxx commented Aug 1, 2019

Is here anything missing, are you in holidays or are you internally discussing about this one?
What is the current status?

puneetbehl added a commit that referenced this issue Jun 23, 2020
Removes default empty string for namespace #44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants