Bug 102958 - Always check that mandatory groups are really mandatory

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1584 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2012-07-09 12:13:45 +00:00
parent abc30277d4
commit cda7adef9e
1 changed files with 22 additions and 20 deletions

View File

@ -312,9 +312,10 @@ sub update {
detaint_natural($new_value); detaint_natural($new_value);
push(@values, $new_value); push(@values, $new_value);
} }
# Is there anything to update?
next unless scalar @fields;
# Is there anything to update?
if (@fields)
{
if ($all_zero) { if ($all_zero) {
$dbh->do('DELETE FROM group_control_map $dbh->do('DELETE FROM group_control_map
WHERE product_id = ? AND group_id = ?', WHERE product_id = ? AND group_id = ?',
@ -337,6 +338,7 @@ sub update {
VALUES ($qmarks)", undef, ($self->id, $gid, @values)); VALUES ($qmarks)", undef, ($self->id, $gid, @values));
} }
} }
}
# If the group is mandatory, restrict all bugs to it. # If the group is mandatory, restrict all bugs to it.
if ($new_setting->{membercontrol} == CONTROLMAPMANDATORY) { if ($new_setting->{membercontrol} == CONTROLMAPMANDATORY) {