aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
authorCaiCandong <50507092+CaiCandong@users.noreply.github.com>2023-08-17 21:19:24 +0800
committerGitHub <noreply@github.com>2023-08-17 13:19:24 +0000
commit940f9975120a8d9e782a457edd5ccf1129ab746a (patch)
tree06525a906586c2410253752969e08837dce80953 /routers/web/repo
parentc179ab423600b23f5b095a620e4d3b514353c0af (diff)
downloadgitea-940f9975120a8d9e782a457edd5ccf1129ab746a.tar.gz
gitea-940f9975120a8d9e782a457edd5ccf1129ab746a.zip
Fix label filter between `all` and `no` (#26557)
Regression of https://github.com/go-gitea/gitea/pull/25886. # Description For `labelIDs`: https://github.com/go-gitea/gitea/blob/9afcb0e0461aa48a4fbda7740d4c5424911e35ef/routers/web/repo/issue.go#L171-L174 - `nil` mean no filter - `[0]` mean `no label` filter When `selectLabels == "0"`, labelIDs should be `[0]` rather than `nil` # Before: https://github.com/go-gitea/gitea/assets/50507092/3dac5075-6da0-4769-ba20-48a56f4063c0 # After: https://github.com/go-gitea/gitea/assets/50507092/ff79fd4c-b02e-4dfb-9309-ae7851f4dcdb Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/issue.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go
index 488c97b0eb..565687defb 100644
--- a/routers/web/repo/issue.go
+++ b/routers/web/repo/issue.go
@@ -177,7 +177,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
ctx.Data["AllLabels"] = true
} else if selectLabels == "0" {
ctx.Data["NoLabel"] = true
- } else if len(selectLabels) > 0 {
+ }
+ if len(selectLabels) > 0 {
labelIDs, err = base.StringsToInt64s(strings.Split(selectLabels, ","))
if err != nil {
ctx.ServerError("StringsToInt64s", err)