1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-06-29 01:45:30 +00:00
Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
a1012112796 2024-06-03 06:49:47 +00:00
parent 85b93b2438
commit aa91afbe4a
No known key found for this signature in database
GPG Key ID: E5FB19032C2C2A64
2 changed files with 11 additions and 3 deletions

View File

@ -42,6 +42,8 @@ func (issue *Issue) LoadProjectIssue(ctx context.Context) (err error) {
return err
}
issue.ProjectIssue.Project = issue.Project
return issue.ProjectIssue.LoadProjectColumn(ctx)
}

View File

@ -14,9 +14,10 @@ import (
// ProjectIssue saves relation from issue to a project
type ProjectIssue struct { //revive:disable-line:exported
ID int64 `xorm:"pk autoincr"`
IssueID int64 `xorm:"INDEX"`
ProjectID int64 `xorm:"INDEX"`
ID int64 `xorm:"pk autoincr"`
IssueID int64 `xorm:"INDEX"`
ProjectID int64 `xorm:"INDEX"`
Project *Project `xorm:"-"`
// ProjectColumnID should not be zero since 1.22. If it's zero, the issue will not be displayed on UI and it might result in errors.
ProjectColumnID int64 `xorm:"'project_board_id' INDEX"`
@ -70,6 +71,11 @@ func (issue *ProjectIssue) LoadProjectColumn(ctx context.Context) error {
var err error
if issue.ProjectColumnID == 0 {
issue.ProjectColumn, err = issue.Project.GetDefaultColumn(ctx)
return err
}
issue.ProjectColumn, err = GetColumn(ctx, issue.ProjectColumnID)
return err
}