aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue.go
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-08 05:03:53 -0400
committerGitHub <noreply@github.com>2023-06-08 11:03:53 +0200
commit1cc63ade8216d816569884e70d7d2431a9bb2587 (patch)
treea9543cc91cb040fbccbf1589cb0ab1713519d46f /routers/web/repo/issue.go
parenteac1bddb8da2e26a3f6d6678b9888c65418cf318 (diff)
downloadgitea-1cc63ade8216d816569884e70d7d2431a9bb2587.tar.gz
gitea-1cc63ade8216d816569884e70d7d2431a9bb2587.zip
Fix `MilestoneIDs` when querying issues (#25125) (#25141)
Backport #25125 by @Zettat123 Fix #25114 Co-authored-by: Zettat123 <zettat123@gmail.com>
Diffstat (limited to 'routers/web/repo/issue.go')
-rw-r--r--routers/web/repo/issue.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index cbb2e20314..5ab8db2e05 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -202,6 +202,11 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
}
}
+ var mileIDs []int64
+ if milestoneID > 0 || milestoneID == db.NoConditionID { // -1 to get those issues which have no any milestone assigned
+ mileIDs = []int64{milestoneID}
+ }
+
var issueStats *issues_model.IssueStats
if forceEmpty {
issueStats = &issues_model.IssueStats{}
@@ -209,7 +214,7 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
issueStats, err = issues_model.GetIssueStats(&issues_model.IssuesOptions{
RepoIDs: []int64{repo.ID},
LabelIDs: labelIDs,
- MilestoneIDs: []int64{milestoneID},
+ MilestoneIDs: mileIDs,
ProjectID: projectID,
AssigneeID: assigneeID,
MentionedID: mentionedID,
@@ -244,11 +249,6 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
}
pager := context.NewPagination(total, setting.UI.IssuePagingNum, page, 5)
- var mileIDs []int64
- if milestoneID > 0 || milestoneID == db.NoConditionID { // -1 to get those issues which have no any milestone assigned
- mileIDs = []int64{milestoneID}
- }
-
var issues []*issues_model.Issue
if forceEmpty {
issues = []*issues_model.Issue{}