fix(project): correctly set done bucket after duplicating project

Resolves https://community.vikunja.io/t/duplicating-projects-with-a-kanband-done-bucket-is-broken/2979
This commit is contained in:
kolaente
2024-11-19 19:23:08 +01:00
parent 940b450a56
commit 0b9fd2c485

View File

@@ -216,6 +216,16 @@ func duplicateViews(s *xorm.Session, pd *ProjectDuplicate, doer web.Auth, taskMa
bucketMap[oldBucketID] = b.ID
}
for _, view := range views {
if view.DoneBucketID != 0 {
view.DoneBucketID = bucketMap[view.DoneBucketID]
err = view.Update(s, doer)
if err != nil {
return err
}
}
}
oldTaskBuckets := []*TaskBucket{}
err = s.In("bucket_id", oldBucketIDs).Find(&oldTaskBuckets)
if err != nil {