From 0b8b4106be1e09a155509e4622e19072fe52e26d Mon Sep 17 00:00:00 2001 From: jaqra Date: Thu, 24 Oct 2019 21:31:06 +0300 Subject: [PATCH 1/2] make call createMilestoneComment on newIssue func --- models/issue.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/issue.go b/models/issue.go index f0069178911d0..9365d6f58596d 100644 --- a/models/issue.go +++ b/models/issue.go @@ -970,6 +970,10 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) { if _, err = e.Exec("UPDATE `milestone` SET num_issues=num_issues+1 WHERE id=?", opts.Issue.MilestoneID); err != nil { return err } + + if _, err = createMilestoneComment(e, doer, opts.Repo, opts.Issue, -1, opts.Issue.MilestoneID); err != nil { + return err + } } // Insert the assignees From 59d26aa2a1826663497602a33238e7630c616fe2 Mon Sep 17 00:00:00 2001 From: jaqra Date: Fri, 25 Oct 2019 01:08:52 +0300 Subject: [PATCH 2/2] make OldMilestoneID 0 instead of -1 --- models/issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/issue.go b/models/issue.go index 9365d6f58596d..52af872cccf0a 100644 --- a/models/issue.go +++ b/models/issue.go @@ -971,7 +971,7 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) { return err } - if _, err = createMilestoneComment(e, doer, opts.Repo, opts.Issue, -1, opts.Issue.MilestoneID); err != nil { + if _, err = createMilestoneComment(e, doer, opts.Repo, opts.Issue, 0, opts.Issue.MilestoneID); err != nil { return err } }