From 6c5266c9cadf500ec8a166066bf4452801cc2545 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 4 Sep 2020 03:36:56 +0200 Subject: [BugFix] Fix comment broken issue ref dependence (#12651) * deleteIssuesByRepoID: delete related CommentTypeRemoveDependency & CommentTypeAddDependency comments too * Ignore ErrIssueNotExist on comment.LoadDepIssueDetails() * Add migration * Ignore 'dependent_issue_id = 0' case * exchange as per @lunny Co-authored-by: techknowlogick --- routers/repo/issue.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'routers/repo') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 4bbc355027..4c745ed5d7 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -1079,8 +1079,10 @@ func ViewIssue(ctx *context.Context) { } } else if comment.Type == models.CommentTypeRemoveDependency || comment.Type == models.CommentTypeAddDependency { if err = comment.LoadDepIssueDetails(); err != nil { - ctx.ServerError("LoadDepIssueDetails", err) - return + if !models.IsErrIssueNotExist(err) { + ctx.ServerError("LoadDepIssueDetails", err) + return + } } } else if comment.Type == models.CommentTypeCode || comment.Type == models.CommentTypeReview { comment.RenderedContent = string(markdown.Render([]byte(comment.Content), ctx.Repo.RepoLink, -- cgit v1.2.3