1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05: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 return err
} }
issue.ProjectIssue.Project = issue.Project
return issue.ProjectIssue.LoadProjectColumn(ctx) return issue.ProjectIssue.LoadProjectColumn(ctx)
} }

View File

@ -17,6 +17,7 @@ type ProjectIssue struct { //revive:disable-line:exported
ID int64 `xorm:"pk autoincr"` ID int64 `xorm:"pk autoincr"`
IssueID int64 `xorm:"INDEX"` IssueID int64 `xorm:"INDEX"`
ProjectID 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 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"` ProjectColumnID int64 `xorm:"'project_board_id' INDEX"`
@ -70,6 +71,11 @@ func (issue *ProjectIssue) LoadProjectColumn(ctx context.Context) error {
var err error var err error
if issue.ProjectColumnID == 0 {
issue.ProjectColumn, err = issue.Project.GetDefaultColumn(ctx)
return err
}
issue.ProjectColumn, err = GetColumn(ctx, issue.ProjectColumnID) issue.ProjectColumn, err = GetColumn(ctx, issue.ProjectColumnID)
return err return err
} }