Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-1111

[regression] "newJob" and "people" link don't care about webapp path

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • other
    • None
    • Platform: All, OS: All

      My hudson install is available at the address
      http://septs102.seat.it:1919/hudson/
      When I click on link "New Job" the browsers goes to
      http://septs102.seat.it:1919/newJob
      instead than
      http://septs102.seat.it:1919/hudson/newJob

      Same issue for the "people" link

      I've upgraded from 161 to 163 and with 161 there wasn't such issue

          [JENKINS-1111] [regression] "newJob" and "people" link don't care about webapp path

          dwdyer added a comment -
              • Issue 1112 has been marked as a duplicate of this issue. ***

          dwdyer added a comment - Issue 1112 has been marked as a duplicate of this issue. ***

          dwdyer added a comment -

          This appears to have been introduced by a change in version 1.5 of
          sidepanel.jelly.

          The getUrl() method in Hudson.java is deprecated and just returns an empty
          string. It has a comment suggesting that getRootUrl() should be used instead.

          This explains the behaviour. The URL is retrieved, it's empty, a slash is
          added and then "newJob" or "people" is appended to that. The slash is the
          killer as it means the URL is no longer relative.

          dwdyer added a comment - This appears to have been introduced by a change in version 1.5 of sidepanel.jelly. The getUrl() method in Hudson.java is deprecated and just returns an empty string. It has a comment suggesting that getRootUrl() should be used instead. This explains the behaviour. The URL is retrieved, it's empty, a slash is added and then "newJob" or "people" is appended to that. The slash is the killer as it means the URL is no longer relative.

          dwdyer added a comment -

          Fixed links to use ${it.rootUrl} instead of ${it.url}. The Manage link still
          uses ${rootURL}. I've left that as it is. I'm not sure what the distinction
          is and have tried to change only the absolute minimum.

          This is in version 1.7 of sidebar.jelly and should make it into Hudson 164.

          Also, perhaps the getUrl() method should throw an exception rather than fail
          silently?

          dwdyer added a comment - Fixed links to use ${it.rootUrl} instead of ${it.url}. The Manage link still uses ${rootURL}. I've left that as it is. I'm not sure what the distinction is and have tried to change only the absolute minimum. This is in version 1.7 of sidebar.jelly and should make it into Hudson 164. Also, perhaps the getUrl() method should throw an exception rather than fail silently?

          fridrik added a comment -

          thank you

          fridrik added a comment - thank you

          towe added a comment -

          When installing Hudson on a remote host (i.e. not localhost), the "New Job" and
          the "People" links do not work (they will point to localhost) in version 1.167.
          After changing "\hudson\model\View\sidepanel.jelly" in the following way, it
          seems to work fine:

          ...

          <l:tasks>

          <l:task icon="images/24x24/new-package.gif" href="${rootURL}/newJob"
          title="${%New Job}" permission="${it.itemCreatePermission}" />

          <l:task icon="images/24x24/setting.gif" href="${rootURL}/manage"
          title="${%Manage Hudson}" permission="${app.ADMINISTER}" />

          <j:if test="${it.hasPeople()}">

          <l:task icon="images/24x24/user.gif" href="${rootURL}/people/" title="${%People}" />

          </j:if>

          <st:include page="sidepanel2.jelly" />

          </l:tasks>

          ...

          towe added a comment - When installing Hudson on a remote host (i.e. not localhost), the "New Job" and the "People" links do not work (they will point to localhost) in version 1.167. After changing "\hudson\model\View\sidepanel.jelly" in the following way, it seems to work fine: ... <l:tasks> <l:task icon="images/24x24/new-package.gif" href="${rootURL}/newJob" title="${%New Job}" permission="${it.itemCreatePermission}" /> <l:task icon="images/24x24/setting.gif" href="${rootURL}/manage" title="${%Manage Hudson}" permission="${app.ADMINISTER}" /> <j:if test="${it.hasPeople()}"> <l:task icon="images/24x24/user.gif" href="${rootURL}/people/" title="${%People}" /> </j:if> <st:include page="sidepanel2.jelly" /> </l:tasks> ...

          dwdyer added a comment -

          Changed these links to use ${rootURL} instead of {$it.rootUrl} as suggested.
          Checked in for Hudson 168.

          This change also applies to my fix to ISSUE#1142.

          dwdyer added a comment - Changed these links to use ${rootURL} instead of {$it.rootUrl} as suggested. Checked in for Hudson 168. This change also applies to my fix to ISSUE#1142.

            dwdyer dwdyer
            fridrik fridrik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: