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:
@ -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],
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user