Skip to content

[JENKINS-52164] New AbstractItem renaming template broken if URL is not defined in sidepanel.jelly #19850

Description

@jenkins-infra-bot

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.


Originally reported by dnusbaum, imported from: New AbstractItem renaming template broken if URL is not defined in sidepanel.jelly
  • assignee: dnusbaum
  • status: Resolved
  • priority: Minor
  • component(s): core
  • label(s): regression
  • resolution: Fixed
  • resolved: 2018-07-02T16:23:25+00:00
  • votes: 0
  • watchers: 1
  • imported: 2025-11-24
Raw content of original issue

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.

  • environment: Jenkins Core >= 2.110

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions