0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-15 04:13:35 +02:00

fix: handle id=0 as remove-from-all-projects in UpdateIssueProject

This commit is contained in:
beardev-in 2026-05-03 18:55:46 +05:30
parent 56461206f5
commit ae9fff3d3f
No known key found for this signature in database
GPG Key ID: 625E0CB70AFF32B9

View File

@ -293,7 +293,7 @@ func ViewProject(ctx *context.Context) {
return
}
columns, err := project_model.GetProjectColumns(ctx, project.ID, db.ListOptionsAll)
columns, err := project.GetColumns(ctx)
if err != nil {
ctx.ServerError("GetProjectColumns", err)
return
@ -449,6 +449,14 @@ func UpdateIssueProject(ctx *context.Context) {
}
projectIDs := ctx.FormStringInt64s("id")
// Remove zero values - id=0 means "remove from all projects"
filteredIDs := make([]int64, 0, len(projectIDs))
for _, id := range projectIDs {
if id != 0 {
filteredIDs = append(filteredIDs, id)
}
}
projectIDs = filteredIDs
var failedIssues []int64
for _, issue := range issues {
if err := issues_model.IssueAssignOrRemoveProject(ctx, issue, ctx.Doer, projectIDs); err != nil {