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

New AbstractItem renaming template broken if URL is not defined in sidepanel.jelly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins Core >= 2.110
    • Similar Issues:
    • Released As:
      Jenkins 2.130

      Description

      The Jelly template for RenameAction added in jenkinsci/jenkins#3289 is incorrect for items who do not define a variable in the template that includes the rename action named url that contains the item's URL (Generally this is items that don't inherit from AbstractProject). This was found when we tried to make folders use the new renaming method and the URL created for the action was http(s)://$JENKINS/confirm-rename, when it should have been http(s)://$JENKINS/job/$FOLDER/confirm-rename.

      In particular, the url variable used in RenameAction/action.jelly is defined in AbstractProject/sidepanel.jelly, but not all AbstractItem subclasses extend AbstractProject.

      This is a regression for any Job types extending Job but not AbstractProject where Job#isNameEditable returns true and where a url variable is not set in the template that includes the Job's actions, but I don't know how common that is. I thought it might affect Pipeline since WorkflowJob does not extend AbstractProject, but fortunately url is defined in WorkflowJob/sidepanel.jelly so it works fine.

      To fix this we can copy the code to generate the URL into RenameAction/action.jelly.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dnusbaum Devin Nusbaum
              Reporter:
              dnusbaum Devin Nusbaum
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: