summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-08-23 05:48:44 +0200
committerlpsolit%gmail.com <>2005-08-23 05:48:44 +0200
commit38c2d4b6e1b3723833e5dca4001692531d1ffc3f (patch)
tree77668489ce38556c7b0d7fae085591ba71cad867
parent947c6e6e8c1451647bbf9b967bd95bfe4ec6fdfa (diff)
downloadbugzilla-38c2d4b6e1b3723833e5dca4001692531d1ffc3f.tar.gz
bugzilla-38c2d4b6e1b3723833e5dca4001692531d1ffc3f.tar.xz
Bug 305451: GetGroupsByUserId() in buglist.cgi returns bad data (regression) - Patch by Joel Peshkin <bugreport@peshkin.net> r=LpSolit a=justdave
-rwxr-xr-xbuglist.cgi17
1 files changed, 6 insertions, 11 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 63ab55951..70cc46bae 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -309,25 +309,20 @@ sub GetQuip {
return $quip;
}
-sub GetGroupsByUserId {
- my ($userid) = @_;
+sub GetGroups {
my $dbh = Bugzilla->dbh;
- return if !$userid;
-
# Create an array where each item is a hash. The hash contains
# as keys the name of the columns, which point to the value of
# the columns for that row.
+ my $grouplist = Bugzilla->user->groups_as_string;
my $groups = $dbh->selectall_arrayref(
- "SELECT DISTINCT groups.id, name, description, isactive
+ "SELECT id, name, description, isactive
FROM groups
- INNER JOIN user_group_map
- ON user_group_map.group_id = groups.id
- WHERE user_id = ?
- AND isbless = 0
+ WHERE id IN ($grouplist)
AND isbuggroup = 1
ORDER BY description "
- , {Slice => {}}, ($userid));
+ , {Slice => {}});
return $groups;
}
@@ -994,7 +989,7 @@ if ($dotweak) {
$vars->{'bugstatuses'} = [ keys %$bugstatuses ];
# The groups to which the user belongs.
- $vars->{'groups'} = GetGroupsByUserId($::userid);
+ $vars->{'groups'} = GetGroups();
# If all bugs being changed are in the same product, the user can change
# their version and component, so generate a list of products, a list of