From 88c2f0a2899d18dbbe5ac8b10dda6362a247b30b Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 2 Apr 2026 19:06:49 +0200 Subject: [PATCH] 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 --- pkg/models/project.go | 2 -- pkg/webtests/archived_test.go | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/models/project.go b/pkg/models/project.go index bcb3b9d17..03d8165fa 100644 --- a/pkg/models/project.go +++ b/pkg/models/project.go @@ -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") diff --git a/pkg/webtests/archived_test.go b/pkg/webtests/archived_test.go index 2c3a9c587..6a3d6f63b 100644 --- a/pkg/webtests/archived_test.go +++ b/pkg/webtests/archived_test.go @@ -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`) + }) }