Grails

pluginContextPath contains wrong path

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 0.5.5
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows

Description

Using pluginContextPath within plugin I expected path to be something like:

<script type="text/javascript" src="/testfivefive//plugins/GrailsExtUi-0.1/js/ext-ui/prototype.js"></script>

But actually it was:

<script type="text/javascript" src="/testfivefive//testfivefive/plugins/GrailsExtUi-0.1/js/ext-ui/prototype.js"></script>

Issue Links

Activity

Hide
Lee Butts added a comment -

Hi Marcel,

did you generate the above code using a g:javascript tag?
I've found a problem with that tag and updated it to be "plugin aware" .

From my tests, pluginContextPath seems to be working correctly, do you have any other examples of this problem?

cheers

Lee

Show
Lee Butts added a comment - Hi Marcel, did you generate the above code using a g:javascript tag? I've found a problem with that tag and updated it to be "plugin aware" . From my tests, pluginContextPath seems to be working correctly, do you have any other examples of this problem? cheers Lee
Hide
Marcel Overdijk added a comment -

Hi Lee, - welcome to the team by the way, I believe I didn't welcomed you yet... shame on me -

The problem is <g:createLinkTo> tag

I have gsp in the views directory of a plugin.
E.g.: D:\Grails\projects\testfivefive\plugins\GrailsExtUi-0.1\grails-app\views\extUi

This gsp contains the following line:
<script type="text/javascript" src="<g:createLinkTo dir="${pluginContextPath}" file="js/ext-ui/prototype.js" />"></script>

When rendered it displays the following in the html:
<script type="text/javascript" src="/testfivefive//testfivefive/plugins/GrailsExtUi-0.1/js/ext-ui/prototype.js"></script>

I'm using the latest updated code from svn.

Cheers,
Marcel

Show
Marcel Overdijk added a comment - Hi Lee, - welcome to the team by the way, I believe I didn't welcomed you yet... shame on me - The problem is <g:createLinkTo> tag I have gsp in the views directory of a plugin. E.g.: D:\Grails\projects\testfivefive\plugins\GrailsExtUi-0.1\grails-app\views\extUi This gsp contains the following line: <script type="text/javascript" src="<g:createLinkTo dir="${pluginContextPath}" file="js/ext-ui/prototype.js" />"></script> When rendered it displays the following in the html: <script type="text/javascript" src="/testfivefive//testfivefive/plugins/GrailsExtUi-0.1/js/ext-ui/prototype.js"></script> I'm using the latest updated code from svn. Cheers, Marcel
Hide
Lee Butts added a comment -

Hi Marcel,

pluginContextPath should now resolve to "plugins/my-plugin-name" or "" (empty string)

Also, you should also be able to just use

<g:javascript src="ext-ui/prototype.js"/>

instead of

<script type="text/javascript" src="<g:createLinkTo dir="${pluginContextPath}" file="js/ext-ui/prototype.js" />"></script>

as the javascript tag is now plugin "aware"

please give it a good re-test to make sure I haven't created any unwanted side-effects

cheers

Lee

Show
Lee Butts added a comment - Hi Marcel, pluginContextPath should now resolve to "plugins/my-plugin-name" or "" (empty string) Also, you should also be able to just use <g:javascript src="ext-ui/prototype.js"/> instead of <script type="text/javascript" src="<g:createLinkTo dir="${pluginContextPath}" file="js/ext-ui/prototype.js" />"></script> as the javascript tag is now plugin "aware" please give it a good re-test to make sure I haven't created any unwanted side-effects cheers Lee
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: