aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorCaiCandong <50507092+CaiCandong@users.noreply.github.com>2023-08-15 22:50:12 +0800
committerGitHub <noreply@github.com>2023-08-15 14:50:12 +0000
commit0e74fc4a84fb27ad7b3aab87e1ef2b9be9d74815 (patch)
tree8952c7a7fd22a5ae6a15d59a8e011f6bb7950e7a /modules
parent7f8028e5a1ee5e99ef491bf037a7171998322bd2 (diff)
downloadgitea-0e74fc4a84fb27ad7b3aab87e1ef2b9be9d74815.tar.gz
gitea-0e74fc4a84fb27ad7b3aab87e1ef2b9be9d74815.zip
Fix project filter bugs (#26490)
related: #26012 ### Bugs 1. missing project filter on the issue page. https://github.com/go-gitea/gitea/blob/1e76a824bcd71acd59cdfb2c4547806bc34b3d86/modules/indexer/issues/dboptions.go#L11-L15 3. incorrect SQL condition: some issue does not belong to a project but exists on the project_issue table. https://github.com/go-gitea/gitea/blob/f5dbac9d36f1678b928bee04e85fbd045c725698/models/issues/issue_search.go#L233 ### Before: ![before](https://github.com/go-gitea/gitea/assets/50507092/1dcde39e-3e2f-4151-b2c6-4d67bf493c2f) ### After: ![after](https://github.com/go-gitea/gitea/assets/50507092/badfb81f-056d-4a2f-9838-1cba9c15768d) --------- Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/indexer/issues/dboptions.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/indexer/issues/dboptions.go b/modules/indexer/issues/dboptions.go
index 6a41afadd7..d0ef1c96b4 100644
--- a/modules/indexer/issues/dboptions.go
+++ b/modules/indexer/issues/dboptions.go
@@ -17,6 +17,10 @@ func ToSearchOptions(keyword string, opts *issues_model.IssuesOptions) *SearchOp
IsClosed: opts.IsClosed,
}
+ if opts.ProjectID != 0 {
+ searchOpt.ProjectID = &opts.ProjectID
+ }
+
if len(opts.LabelIDs) == 1 && opts.LabelIDs[0] == 0 {
searchOpt.NoLabelOnly = true
} else {