fix(views): return only tasks when the bucket id was already specified

This commit is contained in:
kolaente 2024-03-19 13:55:28 +01:00
parent 7c30b00668
commit e940db6d32
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ package models
import (
"code.vikunja.io/api/pkg/user"
"code.vikunja.io/web"
"strings"
"xorm.io/xorm"
)
@ -120,7 +121,7 @@ func getTaskFilterOptsFromCollection(tf *TaskCollection, projectView *ProjectVie
}
func getTaskOrTasksInBuckets(s *xorm.Session, a web.Auth, projects []*Project, view *ProjectView, opts *taskSearchOptions) (tasks interface{}, resultCount int, totalItems int64, err error) {
if view != nil {
if view != nil && !strings.Contains(opts.filter, "bucket_id") {
if view.BucketConfigurationMode != BucketConfigurationModeNone {
tasksInBuckets, err := GetTasksInBucketsForView(s, view, projects, opts, a)
return tasksInBuckets, len(tasksInBuckets), int64(len(tasksInBuckets)), err