Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Empty string for contextPath not working correctly with resource tag #6

Merged
merged 1 commit into from

2 participants

@RGBz

Howdy,

We're using Grails 1.4 and 2.0. When using the stylesheet tag of the lesscss plugin we would receive a 404 error because the plugin was requesting my less files with an incorrect URL.

I tracked down the issue. For some reason passing a contextPath of "" to the resource tag doesn't work as expected (see line 116 in the generateRelativePath() method of the LessTagLib). I added an if statement on the contextPath so that it won't be passed as an argument to the resource tag call if it doesn't exist. This fixes the URL when a contextPath isn't specified such that the generated URL refers to the default context path.

Thanks for putting this plugin together. It works really well!

@davidmarquis davidmarquis merged commit ca0605a into davidmarquis:master
@RGBz

Hi David,

Can you deploy the latest code to the Grails plug-in portal?

Thanks,
Anton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 grails-app/taglib/grails/lesscss/LessTagLib.groovy
View
6 grails-app/taglib/grails/lesscss/LessTagLib.groovy
@@ -113,7 +113,11 @@ class LessTagLib {
}
StringBuilder path = new StringBuilder()
- path << g.resource(plugin:plugin ?: null, contextPath: contextPath ?: '', dir: dir, file: name)
+ if(contextPath) {
+ path << g.resource(plugin:plugin ?: null, contextPath: contextPath ?: '', dir: dir, file: name)
+ } else {
+ path << g.resource(plugin:plugin ?: null, dir: dir, file: name)
+ }
if (extension) {
path << extension
}
Something went wrong with that request. Please try again.