fix(project): remove non-existent columns from UpdateProject column list

The UpdateProject function referenced done_bucket_id and default_bucket_id
in its column update list, but these columns belong to the project_views
table, not the projects table. This caused SQL errors when archiving or
updating a project on MySQL/PostgreSQL.

Also adds a test for archiving a non-archived project.

Fixes #2459
This commit is contained in:
kolaente 2026-04-02 19:06:49 +02:00 committed by kolaente
parent ea54f3eb85
commit 88c2f0a289
2 changed files with 6 additions and 2 deletions

View File

@ -1013,8 +1013,6 @@ func UpdateProject(s *xorm.Session, project *Project, auth web.Auth, updateProje
"hex_color",
"parent_project_id",
"position",
"done_bucket_id",
"default_bucket_id",
}
if project.Description != "" {
colsToUpdate = append(colsToUpdate, "description")

View File

@ -193,4 +193,10 @@ func TestArchived(t *testing.T) {
taskTests("36", models.ErrCodeProjectIsArchived, t)
})
// Archiving a non-archived project should work
t.Run("archive non-archived project", func(t *testing.T) {
rec, err := testProjectHandler.testUpdateWithUser(nil, map[string]string{"project": "1"}, `{"title":"Test1","is_archived":true}`)
require.NoError(t, err)
assert.Contains(t, rec.Body.String(), `"is_archived":true`)
})
}