1
0

fix(views): do not create task bucket and task position entries when duplicating a project

Resolves https://github.com/go-vikunja/vikunja/issues/297
Resolves https://community.vikunja.io/t/duplicating-a-board-puts-the-buckets-in-the-original-board/2579

(cherry picked from commit b83448b7a6d78fea07e3e88af45a468b7d5b968b)
This commit is contained in:
kolaente
2024-08-12 15:53:51 +02:00
parent 2b9b77bef2
commit 0434a96c3a
2 changed files with 20 additions and 13 deletions

View File

@ -180,7 +180,7 @@ func duplicateViews(s *xorm.Session, pd *ProjectDuplicate, doer web.Auth, taskMa
view.ID = 0
view.ProjectID = pd.Project.ID
err = createProjectView(s, view, doer, false)
err = createProjectView(s, view, doer, false, false)
if err != nil {
return
}
@ -225,8 +225,9 @@ func duplicateViews(s *xorm.Session, pd *ProjectDuplicate, doer web.Auth, taskMa
taskBuckets := []*TaskBucket{}
for _, tb := range oldTaskBuckets {
taskBuckets = append(taskBuckets, &TaskBucket{
BucketID: bucketMap[tb.BucketID],
TaskID: taskMap[tb.TaskID],
BucketID: bucketMap[tb.BucketID],
TaskID: taskMap[tb.TaskID],
ProjectViewID: viewMap[tb.ProjectViewID],
})
}