[Issue 4720] New - Sidebar link plugin automatically adds forward-slash to end of link

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Issue 4720] New - Sidebar link plugin automatically adds forward-slash to end of link

cb372
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720
                 Issue #|4720
                 Summary|Sidebar link plugin automatically adds forward-slash t
                        |o end of link
               Component|hudson
                 Version|current
                Platform|All
              OS/Version|All
                     URL|
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|sidebar-link
             Assigned to|mindless
             Reported by|cb372






------- Additional comments from [hidden email] Tue Oct 27 02:37:07 +0000 2009 -------
Using the sidebar link plugin, I added links to EMMA coverage reports of the form:

http://myserver:8081/job/MyJob/ws/emma/coverage/coverage.html

But the link automatically gets a forward-slash appended to it, becoming:

http://myserver:8081/job/MyJob/ws/emma/coverage/coverage.html/

This causes all relative links on the coverage report to become invalid and
return 404.

E.g. a link to "_files/4.html" will be translated to

http://myserver:8081/job/MyJob/ws/emma/coverage/coverage.html/_files/4.html

when it should be

http://myserver:8081/job/MyJob/ws/emma/coverage/_files/4.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Issue 4720] Hudson automatically adds forward-slash to end of sidebar link

Alan Harder-2
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720



User mindless changed the following:

                What    |Old value                 |New value
================================================================================
                      CC|''                        |'mindless'
--------------------------------------------------------------------------------
             Assigned to|mindless                  |issues@hudson
--------------------------------------------------------------------------------
              QA contact|mindless                  |issues@hudson
--------------------------------------------------------------------------------
                 Summary|Sidebar link plugin automa|Hudson automatically adds
                        |tically adds forward-slash|forward-slash to end of si
                        | to end of link           |debar link
--------------------------------------------------------------------------------
            Subcomponent|sidebar-link              |core
--------------------------------------------------------------------------------




------- Additional comments from [hidden email] Tue Oct 27 15:44:19 +0000 2009 -------
There is no code in sidebar-link doing that, but I see the behavior too.. Hudson
must be adding the / so changing the category.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Issue 4720] Hudson automatically adds forward-slash to end of sidebar link

Alan Harder-2
In reply to this post by cb372
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720






------- Additional comments from [hidden email] Tue Oct 27 15:49:16 +0000 2009 -------
Confirmed.. Functions.getActionUrl() does this:

        if(urlName.startsWith("/"))
            return Stapler.getCurrentRequest().getContextPath()+urlName+'/';
        else
            // relative URL name
            return
Stapler.getCurrentRequest().getContextPath()+'/'+itUrl+urlName+'/';


so any relative URL (starting with / or not) gets a / on the end.  I wonder if
this behavior can be safely removed?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Issue 4720] Hudson automatically adds forward-slash to end of sidebar link

cb372
In reply to this post by cb372
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720






------- Additional comments from [hidden email] Wed Oct 28 00:57:23 +0000 2009 -------
Thanks for the very fast response!

I'm not familiar with the Hudson source, but at first glance it seems quite
risky to alter that code just to fix this problem. Could have quite far-reaching
side effects?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Issue 4720] Hudson automatically adds forward-slash to end of sidebar link

Alan Harder-2
In reply to this post by cb372
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720



User mindless changed the following:

                What    |Old value                 |New value
================================================================================
             Assigned to|issues@hudson             |mindless
--------------------------------------------------------------------------------




------- Additional comments from [hidden email] Wed Oct 28 03:00:19 +0000 2009 -------
I checked the history, and that slash has been there nearly forever:

Actionable.urlName added in r190
Trailing / added in r347 to fix bug where current link is sometimes not bold
Trailing / removed in r9642 (issues 1679,1335)
Trailing / added back for non-absolute urls in r11319, fix to show current page
in bold

(yes, r347 out of over 23000).. but, it was removed for a while and the bug that
reoccurred is just visual (not showing the current location in bold in the
sidebar).  So I'll investigate a bit and see if the slash can be removed and the
emboldening code updated so we don't add that bug back a 3rd time.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Issue 4720] Hudson automatically adds forward-slash to end of sidebar link

scm_issue_link
In reply to this post by cb372
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720






------- Additional comments from [hidden email] Sun Nov  1 00:01:16 +0000 2009 -------
Code changed in hudson
User: : mindless
Path:
 trunk/hudson/main/core/src/main/java/hudson/Functions.java
http://fisheye4.cenqua.com/changelog/hudson/?cs=23393
Log:
[FIXED HUDSON-4720] Don't always append / to non-absolute action URLs,
as this may break some links (.../*.html for example).
See related HUDSON-1335, HUDSON-1679, r347 and r11319.
Updated hyperlinkMatchesCurrentPage to ignore trailing / in matching
to avoid regression in bold context links.
Also fixed tiny bug introduced in r13815 where "/" was changed to "."
in moving code from jelly to Functions, causing a couple links in
LogRecorder area (with href=".") to not show as bold.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Issue 4720] Hudson automatically adds forward-slash to end of sidebar link

scm_issue_link
In reply to this post by cb372
https://hudson.dev.java.net/issues/show_bug.cgi?id=4720



User scm_issue_link changed the following:

                What    |Old value                 |New value
================================================================================
                  Status|NEW                       |RESOLVED
--------------------------------------------------------------------------------
              Resolution|                          |FIXED
--------------------------------------------------------------------------------




------- Additional comments from [hidden email] Sun Nov  1 00:07:35 +0000 2009 -------
Code changed in hudson
User: : mindless
Path:
 trunk/www/changelog.html
http://fisheye4.cenqua.com/changelog/hudson/?cs=23394
Log:
[FIXED HUDSON-4720] noting fix in r23393


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]