Fix project filter bugs (#26490) (#26558)

Backport  #26490

related: #26012

1. missing project filter on the issue page.


1e76a824bc/modules/indexer/issues/dboptions.go (L11-L15)
2. incorrect SQL condition: some issue does not belong to a project but
exists on the project_issue table.


f5dbac9d36/models/issues/issue_search.go (L233)


![before](1dcde39e-3e2f-4151-b2c6-4d67bf493c2f)


![after](badfb81f-056d-4a2f-9838-1cba9c15768d)
This commit is contained in:
CaiCandong 2023-08-19 18:21:45 +08:00 committed by GitHub
parent 1f29cfa683
commit 94f86964b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 10 deletions

View file

@ -133,10 +133,7 @@ func getIssueStatsChunk(opts *IssuesOptions, issueIDs []int64) (*IssueStats, err
applyMilestoneCondition(sess, opts)
if opts.ProjectID > 0 {
sess.Join("INNER", "project_issue", "issue.id = project_issue.issue_id").
And("project_issue.project_id=?", opts.ProjectID)
}
applyProjectCondition(sess, opts)
if opts.AssigneeID > 0 {
applyAssigneeCondition(sess, opts.AssigneeID)