diff options
-rw-r--r-- | Bugzilla/Product.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index f5c4fae6c..e0a265b69 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -509,10 +509,11 @@ sub group_controls { ORDER BY groups.name}; $self->{group_controls} = $dbh->selectall_hashref($query, 'id', undef, $self->id); - foreach my $group (keys(%{$self->{group_controls}})) { - $self->{group_controls}->{$group}->{'group'} = - new Bugzilla::Group($group); - } + + # For each group ID listed above, create and store its group object. + my @gids = keys %{$self->{group_controls}}; + my $groups = Bugzilla::Group->new_from_list(\@gids); + $self->{group_controls}->{$_->id}->{group} = $_ foreach @$groups; } return $self->{group_controls}; } |