[PR #413] [MERGED] Bug fixes for Issues filters #15366

Closed
opened 2025-11-02 11:44:57 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/413
Author: @ethantkoenig
Created: 12/19/2016
Status: Merged
Merged: 12/24/2016
Merged by: @lunny

Base: masterHead: issue_bug_fixes


📝 Commits (1)

  • 25958d4 Bug fixes for Issues filters

📊 Changes

3 files changed (+76 additions, -88 deletions)

View changed files

📝 models/issue.go (+29 -50)
📝 routers/repo/issue.go (+47 -37)
📝 routers/user/home.go (+0 -1)

📄 Description

Fixes two bugs in the GET :username/:reponame/issues endpoint:

  1. Previously, if there were filters for both assignee and poster (e.g. type="created", assignee=4), the counts (ctx.Data["IssueStats"]) would reflect both filters, but the returned issues (ctx.Data["Issues"]) would only apply the assignee filter.
  2. Previously, if there were two conflicting assignee filters (e.g. type="assigned", assignee=4, and ctx.User.ID=5), only one of the filters would be applied. Now both filters are applied, and 0 issues are returned.

I also took the opportunity to make the IssuesOptions struct less confusing. Previously, there was a misleadingly-named UserID field that only was used for filtering mentioned users, and only if IsMention was set to true. I renamed UserID to MentionedID (which like AssigneeID and ReportedID is ignored if 0), and got rid of IsMention.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/413 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 12/19/2016 **Status:** ✅ Merged **Merged:** 12/24/2016 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `issue_bug_fixes` --- ### 📝 Commits (1) - [`25958d4`](https://github.com/go-gitea/gitea/commit/25958d4370cdc059ccb1a90fb8e70113523e626b) Bug fixes for Issues filters ### 📊 Changes **3 files changed** (+76 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `models/issue.go` (+29 -50) 📝 `routers/repo/issue.go` (+47 -37) 📝 `routers/user/home.go` (+0 -1) </details> ### 📄 Description Fixes two bugs in the `GET :username/:reponame/issues` endpoint: 1. Previously, if there were filters for both assignee and poster (e.g. `type="created", assignee=4`), the counts (`ctx.Data["IssueStats"]`) would reflect both filters, but the returned issues (`ctx.Data["Issues"]`) would only apply the assignee filter. 2. Previously, if there were two conflicting assignee filters (e.g. `type="assigned", assignee=4`, and `ctx.User.ID=5`), only one of the filters would be applied. Now both filters are applied, and 0 issues are returned. I also took the opportunity to make the `IssuesOptions` struct less confusing. Previously, there was a misleadingly-named `UserID` field that only was used for filtering mentioned users, and only if `IsMention` was set to true. I renamed `UserID` to `MentionedID` (which like `AssigneeID` and `ReportedID` is ignored if 0), and got rid of `IsMention`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:44:57 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15366