aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2005-08-19 03:09:36 +0000
committerbugreport%peshkin.net <>2005-08-19 03:09:36 +0000
commit9d4872bef3b679b020b6678445ec84504e1f8a1e (patch)
treeba83ecbc319e12000d9ee00d2da2f04facded3d6 /whine.pl
parentBug 296054: [PostgreSQL] Cannot add a new query for event/whining (diff)
downloadbugzilla-9d4872bef3b679b020b6678445ec84504e1f8a1e.tar.gz
bugzilla-9d4872bef3b679b020b6678445ec84504e1f8a1e.tar.bz2
bugzilla-9d4872bef3b679b020b6678445ec84504e1f8a1e.zip
Bug 304583: Remove all remaining need to rederive inherited groups
Patch by Joel Peshkin <bugreport@peshkin.net> r=mkanat, a=justdave
Diffstat (limited to 'whine.pl')
-rwxr-xr-xwhine.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/whine.pl b/whine.pl
index 259195720..c4a454775 100755
--- a/whine.pl
+++ b/whine.pl
@@ -240,8 +240,7 @@ sub get_next_event {
return undef unless $fetched;
my ($eventid, $owner_id, $subject, $body) = @{$fetched};
- my $owner = Bugzilla::User->new($owner_id,
- DERIVE_GROUPS_TABLES_ALREADY_LOCKED);
+ my $owner = Bugzilla::User->new($owner_id);
my $whineatothers = $owner->in_group('bz_canusewhineatothers');
@@ -275,10 +274,13 @@ sub get_next_event {
my $group_id = Bugzilla::Group::ValidateGroupName(
$groupname, $owner);
if ($group_id) {
+ my $glist = join(',',
+ Bugzilla::User->flatten_group_membership(
+ $group_id));
$sth = $dbh->prepare("SELECT user_id FROM " .
"user_group_map " .
- "WHERE group_id=?");
- $sth->execute($group_id);
+ "WHERE group_id IN ($glist)");
+ $sth->execute();
for my $row (@{$sth->fetchall_arrayref}) {
if (not defined $user_objects{$row->[0]}) {
$user_objects{$row->[0]} =