From e3842b6df7be7adf3b468345b8ac826c1dd26353 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 6 Jun 2023 17:24:27 +0200 Subject: [PATCH] fix(projects): reset pagination limit when fetching subprojects --- pkg/models/project.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/models/project.go b/pkg/models/project.go index 5cf9ee10796..c2d39594e4a 100644 --- a/pkg/models/project.go +++ b/pkg/models/project.go @@ -438,6 +438,9 @@ func getAllProjectsForUser(s *xorm.Session, userID int64, parentProjectIDs []int *projects = append(*projects, currentProjects...) + // If we don't reset the limit for subprojects, it will be impossible to fetch all subprojects. + opts.page = -1 + return getAllProjectsForUser(s, userID, newParentIDs, opts, projects, oldTotalCount+totalCount) }