diff --git a/routers/web/repo/issue_list.go b/routers/web/repo/issue_list.go index 6c0b6e7374..bb00b90270 100644 --- a/routers/web/repo/issue_list.go +++ b/routers/web/repo/issue_list.go @@ -542,7 +542,6 @@ func prepareIssueFilterAndList(ctx *context.Context, milestoneID, projectID int6 RepoIDs: []int64{repo.ID}, LabelIDs: preparedLabelFilter.SelectedLabelIDs, MilestoneIDs: mileIDs, - ProjectIDs: []int64{projectID}, AssigneeID: assigneeID, MentionedID: mentionedID, PosterID: posterUserID, @@ -551,6 +550,11 @@ func prepareIssueFilterAndList(ctx *context.Context, milestoneID, projectID int6 IsPull: isPullOption, IssueIDs: nil, } + + if projectID > 0 { + statsOpts.ProjectIDs = []int64{projectID} + } + if keyword != "" { keywordMatchedIssueIDs, _, err = issue_indexer.SearchIssues(ctx, issue_indexer.ToSearchOptions(keyword, statsOpts)) if err != nil {