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) }