From acdcae1b0c2f6e355390f7e7ddf768c79402c313 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 17 May 2010 09:56:37 -0700 Subject: Bug 556373: Move the adding/removing of groups from process_bug.cgi to Bugzilla::Bug::set_all r=dkl, a=mkanat --- Bugzilla/Bug.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 26e71c4f8..6f2c2b602 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1854,6 +1854,15 @@ sub set_all { my $self = shift; my ($params) = @_; + # strict_isolation checks mean that we should set the groups + # immediately after changing the product. + foreach my $group (@{ $params->{groups}->{add} || [] }) { + $self->add_group($group); + } + foreach my $group (@{ $params->{groups}->{remove} || [] }) { + $self->remove_group($group); + } + if (exists $params->{'dependson'} or exists $params->{'blocked'}) { my %set_deps; foreach my $name (qw(dependson blocked)) { @@ -2400,7 +2409,8 @@ sub add_group { # to this group by the current user. $self->product_obj->group_is_settable($group) || ThrowUserError('group_invalid_restriction', - { product => $self->product, group_id => $group->id }); + { product => $self->product, group_id => $group->id, + bug => $self }); # OtherControl people can add groups only during a product change, # and only when the group is not NA for them. -- cgit v1.2.3-24-g4f1b