diff options
author | lpsolit%gmail.com <> | 2006-08-25 06:41:20 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-08-25 06:41:20 +0200 |
commit | 9fd592efb1b68ed9c4aa1d47151cb8f32d88885f (patch) | |
tree | e9db74864d30eff1483e550e14244592d6f92baa /Bugzilla/Flag.pm | |
parent | 81c13474d68473aa68932c14e6ddaef858a2e91e (diff) | |
download | bugzilla-9fd592efb1b68ed9c4aa1d47151cb8f32d88885f.tar.gz bugzilla-9fd592efb1b68ed9c4aa1d47151cb8f32d88885f.tar.xz |
Bug 345958: Do not throw an error if an inactive flag type is set to "X" while editing a bug - Patch by Frédéric Buclin <LpSolit@gmail.com> a=myk
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r-- | Bugzilla/Flag.pm | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 7888640f9..de90170a3 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -264,17 +264,6 @@ sub validate { # because the bug may be moved into another product meanwhile. # This check will be done later when creating new flags, see FormToNewFlags(). - # All new flags must belong to active flag types. - if (scalar(@flagtype_ids)) { - my $inactive_flagtypes = - $dbh->selectrow_array('SELECT 1 FROM flagtypes - WHERE id IN (' . join(',', @flagtype_ids) . ') - AND is_active = 0 ' . - $dbh->sql_limit(1)); - - ThrowCodeError('flag_type_inactive') if $inactive_flagtypes; - } - if (scalar(@flag_ids)) { # No reference to existing flags should exist when creating a new # attachment. @@ -315,6 +304,11 @@ sub validate { my $flag_type = new Bugzilla::FlagType($id); $flag_type || ThrowCodeError('flag_type_nonexistent', { id => $id }); + # Make sure the flag type is active. + unless ($flag_type->is_active) { + ThrowCodeError('flag_type_inactive', {'type' => $flag_type->name}); + } + _validate(undef, $flag_type, $status, \@requestees, $private_attachment, $bug_id, $attach_id); } |