Skip to content

Fix issue filter #34914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2025
Merged

Fix issue filter #34914

merged 2 commits into from
Jun 30, 2025

Conversation

wxiaoguang
Copy link
Contributor

0 is zero value and won't be put into query parameter by QueryBuild

Fix #34913

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 30, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Jun 30, 2025
@wxiaoguang wxiaoguang added the backport/v1.24 This PR should be backported to Gitea 1.24 label Jun 30, 2025
@wxiaoguang wxiaoguang mentioned this pull request Jun 30, 2025
25 tasks
@wxiaoguang
Copy link
Contributor Author

image

image

@wxiaoguang wxiaoguang changed the title Fix issule & milestone filter Fix issule filter Jun 30, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 30, 2025
@delvh delvh changed the title Fix issule filter Fix issue filter Jun 30, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 30, 2025
@wxiaoguang wxiaoguang merged commit a94e472 into go-gitea:main Jun 30, 2025
26 checks passed
@GiteaBot GiteaBot added this to the 1.25.0 milestone Jun 30, 2025
@wxiaoguang wxiaoguang deleted the fix-no-label branch June 30, 2025 16:33
wxiaoguang added a commit to wxiaoguang/gitea that referenced this pull request Jun 30, 2025
`0` is zero value and won't be put into query parameter by QueryBuild

Fix go-gitea#34913
@wxiaoguang wxiaoguang added backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! labels Jun 30, 2025
@wxiaoguang
Copy link
Contributor Author

Manually backported then no need to wait for the bot.

It seems the for most time the bot only does the backport then main branch gets another push.

@wxiaoguang wxiaoguang added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Jun 30, 2025
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 1, 2025
* giteaofficial/main:
  Fix modal + form abuse (go-gitea#34921)
  [skip ci] Updated translations via Crowdin
  Follow file symlinks in the UI to their target (go-gitea#28835)
  Fix issue filter (go-gitea#34914)
  Fix: RPM package download routing & missing package version count (go-gitea#34909)
  Add support for 3D/CAD file formats preview (go-gitea#34794)
@@ -15,7 +15,7 @@
<input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}">
</div>
<div class="divider"></div>
<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" 0}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
<a class="{{if not $.MilestoneID}}active selected {{end}}item" href="{{QueryBuild $queryLink "milestone" NIL}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we write NIL as uppercase? Shouldn't it work as nil too?

Copy link
Contributor Author

@wxiaoguang wxiaoguang Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, Golang team's strange decision. Template can't use "nil", so we use our template helper function NIL

Maybe related to

https://github.com/golang/go/issues/58326

https://github.com/golang/go/issues/57773

Copy link
Member

@silverwind silverwind Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have a few cases of lowercase nil in the templates, and I recall they work:

templates/repo/file_info.tmpl:7:  {{if ne .NumLines nil}}
templates/repo/file_info.tmpl:12: {{if ne .FileSize nil}}
templates/repo/issue/view_content.tmpl:8:         {{ctx.AvatarUtils.Avatar nil 40}}
templates/repo/issue/view_content/comments.tmpl:21:         {{ctx.AvatarUtils.Avatar nil 40}}
templates/repo/diff/comments.tmpl:6:    <span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's different. Official document and issue have explained.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real example is:

{{$var := nil}}, it fails. We have to use {{$var := NIL}}

wxiaoguang added a commit that referenced this pull request Jul 3, 2025
bdruth added a commit to bdruth/gitea that referenced this pull request Jul 4, 2025
…h/gitea into feature/enhanced-workflow-runs-api

* 'feature/enhanced-workflow-runs-api' of github.com:bdruth/gitea:
  [skip ci] Updated translations via Crowdin
  Follow file symlinks in the UI to their target (go-gitea#28835)
  Fix issue filter (go-gitea#34914)
  Fix: RPM package download routing & missing package version count (go-gitea#34909)
  Add support for 3D/CAD file formats preview (go-gitea#34794)
  Add a `login`/`login-name`/`username` disambiguation to affected endpoint parameters and response/request models (go-gitea#34901)
  Improve tags list page (go-gitea#34898)
  [skip ci] Updated translations via Crowdin
  docs: fix typo in pull request merge warning message text (go-gitea#34899)
  Refactor container package (go-gitea#34877)
  [skip ci] Updated translations via Crowdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.24 This PR should be backported to Gitea 1.24 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/templates This PR modifies the template files skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Label filter doesn't work on Repository Issue Page
5 participants