summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xBugzilla/Bug.pm11
-rwxr-xr-xprocess_bug.cgi2
2 files changed, 12 insertions, 1 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index ad9146504..ec2fd491a 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -1753,6 +1753,17 @@ sub groups {
return $self->{'groups'};
}
+sub groups_in {
+ my $self = shift;
+ return $self->{'groups_in'} if exists $self->{'groups_in'};
+ return [] if $self->{'error'};
+ my $group_ids = Bugzilla->dbh->selectcol_arrayref(
+ 'SELECT group_id FROM bug_group_map WHERE bug_id = ?',
+ undef, $self->id);
+ $self->{'groups_in'} = Bugzilla::Group->new_from_list($group_ids);
+ return $self->{'groups_in'};
+}
+
sub user {
my $self = shift;
return $self->{'user'} if exists $self->{'user'};
diff --git a/process_bug.cgi b/process_bug.cgi
index 8316979b2..dcc0d6543 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -667,7 +667,7 @@ if (defined $cgi->param('id')) {
# on show_bug, thus it would look like the user was trying to
# uncheck them, which would then be denied by the set_ functions,
# throwing a confusing error.)
- if (scalar @{$bug->groups}) {
+ if (scalar @{$bug->groups_in}) {
$bug->set_cclist_accessible($cgi->param('cclist_accessible'))
if $bug->check_can_change_field('cclist_accessible', 0, 1);
$bug->set_reporter_accessible($cgi->param('reporter_accessible'))