Defect #25212
closedUser profile should link to issues assigned to user or his groups
0%
Description
On the user profile page, the count of the issues assigned to the user includes issues assigned to groups of the user, whereas the query the link points to does only include issues directly assigned to the user.
The link without groups and count on the user profile page: source:/trunk/app/views/users/show.html.erb@16340#L28
The Issue.assigned_to
scope specifically including groups: source:/trunk/app/models/issue.rb@16340#L94
A patch to correct this will follow shortly.
Related issues
Updated by Felix Schäfer almost 8 years ago
This adds the group ids to the linked query:
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 9bb5d6667..14fa080e0 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -26,7 +26,7 @@
<h3><%=l(:label_issue_plural)%></h3>
<ul>
<li><%= link_to l(:label_assigned_issues),
- issues_path(:set_filter => 1, :assigned_to_id => @user.id, :sort => 'priority:desc,updated_on:desc') %>:
+ issues_path(:set_filter => 1, :assigned_to_id => ([@user.id] + @user.group_ids).join("|"), :sort => 'priority:desc,updated_on:desc') %>:
<%= Issue.visible.open.assigned_to(@user).count %>
<li><%= link_to l(:label_reported_issues),
issues_path(:set_filter => 1, :status_id => '*', :author_id => @user.id) %>:
A better way would probably be to add the option to also include issues assigned to a user's groups to the issue query, but that's probably a somewhat larger endeavour :-)
Updated by Mischa The Evil over 7 years ago
- Has duplicate Defect #26078: List of issues per assignee doesn't match in profile added
Updated by Mischa The Evil over 7 years ago
- Related to Feature #8153: List assigned issues in user profile page added
Updated by Mischa The Evil over 7 years ago
- Category set to Issues filter
- Status changed from New to Confirmed
- Target version set to 3.2.7
- Affected version changed from 3.3.2 to 3.2.0
Confirmed through #26078:
I wrote:
Confirmed on source:/trunk@16580. The root cause of the issue seems to be #13758 (user groups are ignored when filtering on assigned_to equals user). I see two options:
- fix #13758 by also taking into account the user's groups when filtering on assigned_to equals user;
- workaround #13758 by changing the used filter (source:/trunk/app/views/users/show.html.erb@16580#L29) to also include the user's groups instead of just the user (multiple filter values).
Thanks for reporting and providing a patch for this. I can confirm that the patch solves the discrepancy.
Felix Schäfer wrote:
[...]
A better way would probably be to add the option to also include issues assigned to a user's groups to the issue query, but that's probably a somewhat larger endeavour :-)
I agree. But I too think that your proposed fix suffices for the time being (ie. until #13758 gets implemented). I'll target this issue for inclusion into 3.2.7.
Updated by Mischa The Evil over 7 years ago
- Related to Defect #13758: Issue Filtering 'Assignee = <<me>>' shows group issues, but 'Assignee = Bob' does not added
Updated by Jean-Philippe Lang over 7 years ago
- Subject changed from Discrepancy between assigned to count and linked query on user profile page to User profile should link to issues assigned to user or his groups
- Status changed from Confirmed to Resolved
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
Patch committed, thanks.
Updated by Jean-Philippe Lang over 7 years ago
- Status changed from Resolved to Closed