Skip to content

Commit

Permalink
Fix MilestoneIDs when querying issues (go-gitea#25125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zettat123 authored and GiteaBot committed Jun 8, 2023
1 parent eac1bdd commit 73238f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,19 @@ 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{}
} else {
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,
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit 73238f8

Please sign in to comment.