From f2eac4623d9c53d0f422e286a51fc8f148ef4fa6 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 19 Nov 2024 19:32:09 +0100 Subject: [PATCH] fix(filters): do not crash when paginating bucket with empty filter Resolves https://community.vikunja.io/t/error-in-kanban-view-of-virtual-project-saved-filter/2876/7 --- pkg/models/task_collection.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/models/task_collection.go b/pkg/models/task_collection.go index b4f8d7f7e..c03e143e8 100644 --- a/pkg/models/task_collection.go +++ b/pkg/models/task_collection.go @@ -269,7 +269,11 @@ func (tf *TaskCollection) ReadAll(s *xorm.Session, a web.Auth, search string, pa tc.isSavedFilter = true if tf.Filter != "" { - tc.Filter = "(" + tf.Filter + ") && (" + tc.Filter + ")" + if tc.Filter != "" { + tc.Filter = "(" + tf.Filter + ") && (" + tc.Filter + ")" + } else { + tc.Filter = tf.Filter + } } return tc.ReadAll(s, a, search, page, perPage)