fix(tasks): also delete corresponding task positions (#2840)

Closes [#348](https://github.com/go-vikunja/vikunja/issues/348)

When moving a project, the old task bucket entries (project, saved
filters) will be removed, but not the corresponding position. This has
the effect that the saved_filter event hook UpdateTaskInSavedFilterViews
wrongly assumes that the task doesn't need to be re-added to the saved
filter since the position part still exists.

Reviewed-on: https://kolaente.dev/vikunja/vikunja/pulls/2840
Co-authored-by: Maximilian Bosch <maximilian@mbosch.me>
Co-committed-by: Maximilian Bosch <maximilian@mbosch.me>
This commit is contained in:
Maximilian Bosch
2024-11-18 16:02:05 +00:00
committed by konrad
parent b8c4e0a91e
commit 3bafaa7101

View File

@@ -956,6 +956,10 @@ func (t *Task) Update(s *xorm.Session, a web.Auth) (err error) {
if err != nil {
return err
}
_, err = s.Where("task_id = ?", t.ID).Delete(&TaskPosition{})
if err != nil {
return err
}
for _, view := range views {
var bucketID = view.DoneBucketID