diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-06-17 00:51:28 -0400 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-17 12:51:28 +0800 |
commit | 8fc64741d95aa31665e4238fd7e20396a4cdf813 (patch) | |
tree | 613e6ec6f9d14e939e70345b18e4d115df7862e8 /routers/repo/issue.go | |
parent | ce9b86082c4824917023b1bb480648d0cc56dd04 (diff) | |
download | gitea-8fc64741d95aa31665e4238fd7e20396a4cdf813.tar.gz gitea-8fc64741d95aa31665e4238fd7e20396a4cdf813.zip |
Fix deleted milestone bug (#1942)
* Fix deleted milestone bug
* Use locale for ghost milestone name
* Fix pointer bug
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r-- | routers/repo/issue.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index b94eddc4ef..b5b620dbb3 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -625,6 +625,16 @@ func ViewIssue(ctx *context.Context) { ctx.Handle(500, "LoadMilestone", err) return } + ghostMilestone := &models.Milestone{ + ID: -1, + Name: ctx.Tr("repo.issues.deleted_milestone"), + } + if comment.OldMilestoneID > 0 && comment.OldMilestone == nil { + comment.OldMilestone = ghostMilestone + } + if comment.MilestoneID > 0 && comment.Milestone == nil { + comment.Milestone = ghostMilestone + } } else if comment.Type == models.CommentTypeAssignees { if err = comment.LoadAssignees(); err != nil { ctx.Handle(500, "LoadAssignees", err) |