From 93b9a2acc024839b94178d621c2eb1c7e7b5b81e Mon Sep 17 00:00:00 2001 From: Tony Tsang Date: Tue, 21 Oct 2014 16:27:01 +0800 Subject: [PATCH 1/2] Fix misuse of issue index for issue id. - UpdateAssignee - UpdateIssueMilestone --- routers/repo/issue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/issue.go b/routers/repo/issue.go index e611032e37..a675579349 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -565,7 +565,7 @@ func UpdateIssueMilestone(ctx *middleware.Context) { return } - issueId := com.StrTo(ctx.Params(":index")).MustInt64() + issueId := com.StrTo(ctx.Query("issue")).MustInt64() if issueId == 0 { ctx.Error(404) return @@ -611,7 +611,7 @@ func UpdateAssignee(ctx *middleware.Context) { return } - issueId := com.StrTo(ctx.Params(":index")).MustInt64() + issueId := com.StrTo(ctx.Query("issue")).MustInt64() if issueId == 0 { ctx.Error(404) return From d87a9cb362e43e2f7182c77d7125b0afcdb56e7d Mon Sep 17 00:00:00 2001 From: Tony Tsang Date: Wed, 22 Oct 2014 14:52:49 +0800 Subject: [PATCH 2/2] Avoid setting missing label/milestone/assignee ids Label, milestone, assignee ids are not includes in post request, possible js or form building bug. --- routers/repo/issue.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/repo/issue.go b/routers/repo/issue.go index a675579349..e3a14e193b 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -463,9 +463,9 @@ func UpdateIssue(ctx *middleware.Context, form auth.CreateIssueForm) { } issue.Name = form.IssueName - issue.MilestoneId = form.MilestoneId - issue.AssigneeId = form.AssigneeId - issue.LabelIds = form.Labels + //issue.MilestoneId = form.MilestoneId + //issue.AssigneeId = form.AssigneeId + //issue.LabelIds = form.Labels issue.Content = form.Content // try get content from text, ignore conflict with preview ajax if form.Content == "" {