Fixed showing correct index in issue comment

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-09-05 19:10:15 +02:00 committed by Jonas Franz
parent 743d0cfd49
commit c0d03825d1
2 changed files with 18 additions and 0 deletions

View File

@ -275,6 +275,18 @@ func (c *Comment) LoadAssignees() error {
return nil
}
// Load Dependent Issue Details
func (c *Comment) LoadDepIssueDetails() error {
var err error
if c.DependentIssueID > 0 {
c.DependentIssue, err = getIssueByID(x, c.DependentIssueID)
if err != nil {
return err
}
}
return nil
}
// MailParticipants sends new comment emails to repository watchers
// and mentioned people.
func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (err error) {

View File

@ -28,6 +28,7 @@ import (
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"net/http"
)
const (
@ -683,6 +684,11 @@ func ViewIssue(ctx *context.Context) {
ctx.Handle(500, "LoadAssignees", err)
return
}
} else if comment.Type == models.CommentTypeRemovedDependency || comment.Type == models.CommentTypeAddedDependency{
if err = comment.LoadDepIssueDetails(); err != nil{
ctx.Handle(http.StatusInternalServerError, "LoadDepIssueDetails", err)
return
}
}
}