diff options
Diffstat (limited to 'Bugzilla/Bug.pm')
-rw-r--r-- | Bugzilla/Bug.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index beafcfa8c..f3d635344 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1641,11 +1641,14 @@ sub _check_groups { # First check all the groups they chose to set. foreach my $name (@$group_names) { - # We don't want to expose the existence or non-existence of groups, - # so instead of doing check(), we just do "next" on an invalid - # group. - my $group = new Bugzilla::Group({ name => $name }) or next; - next if !$product->group_is_settable($group); + my $group = Bugzilla::Group->check( + { name => $name, product => $product, + _error => 'group_restriction_not_allowed' }); + + if (!$product->group_is_settable($group)) { + ThrowUserError('group_restriction_not_allowed', + { name => $name, product => $product }); + } $add_groups{$group->id} = $group; } } |