"Edit milestone" in Group's Milestones view leads to 404
Summary
In Group's Milestones view, when you try to edit an open milestone, the Edit
button leads to 404 page instead to the edit page. It seems that the Milestone ID is wrong (or it probably uses some other kind of ID that doesn't work with the milestone editing page?). Funnily enough, the Close milestone
button works just fine, as it uses the same Milestone ID as the Show milestone
link (aka the Milestone title link).
Doing a bit of investigation in the code, I've discovered that the Close milestone
uses milestone.iid
variable, while the Edit
button uses milestone.id
.
Steps to reproduce
- Find a group with at least one open Milestone created in it
- Go to
Group ABC > Issues > Milestones
- Find an open Milestone
- Click on
Edit
button of that Milestone
Example Project
https://gitlab.com/groups/group-milestone-edit-404/milestones
What is the current bug behavior?
Edit
button leads to https://gitlab.com/groups/group-milestone-edit-404/milestones/359983/edit which does not exist (404 error).
What is the expected correct behavior?
Edit
button should lead to https://gitlab.com/groups/group-milestone-edit-404/milestones/1/edit
Output of checks
This bug happens on GitLab.com
Possible fixes
My suspicion about this line is based on another line (https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/helpers/milestones_helper.rb#L159), which seems to create a working link to eg. close the milestone.