mirror of
https://github.com/go-gitea/gitea
synced 2025-08-09 11:08:19 +00:00
Backport #25802 by @yp05327 You can confirm this issue in https://try.gitea.io/yp05327/testrepo/issues/2 Before:  After:  This issue comes from the change in #25468. `LoadProject` will always return at least one record, so we use `ProjectID` to check whether an issue is linked to a project in the old code. As other `issue.LoadXXX` functions, we need to check the return value from `xorm.Session.Get`. In recent unit tests, we only test `issueList.LoadAttributes()` but don't test `issue.LoadAttributes()`. So I added a new test for `issue.LoadAttributes()` in this PR. Co-authored-by: yp05327 <576951401@qq.com> Co-authored-by: Denys Konovalov <privat@denyskon.de>
This commit is contained in:
@@ -437,8 +437,7 @@ func UpdateIssueProject(ctx *context.Context) {
|
||||
projectID := ctx.FormInt64("id")
|
||||
for _, issue := range issues {
|
||||
if issue.Project != nil {
|
||||
oldProjectID := issue.Project.ID
|
||||
if oldProjectID == projectID {
|
||||
if issue.Project.ID == projectID {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
@@ -386,8 +386,7 @@ func UpdateIssueProject(ctx *context.Context) {
|
||||
projectID := ctx.FormInt64("id")
|
||||
for _, issue := range issues {
|
||||
if issue.Project != nil {
|
||||
oldProjectID := issue.Project.ID
|
||||
if oldProjectID == projectID {
|
||||
if issue.Project.ID == projectID {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user