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
This commit is contained in:
Родитель
6b1f9a0101
Коммит
f2ef8f158d
|
@ -264,17 +264,6 @@ sub validate {
|
||||||
# because the bug may be moved into another product meanwhile.
|
# because the bug may be moved into another product meanwhile.
|
||||||
# This check will be done later when creating new flags, see FormToNewFlags().
|
# 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)) {
|
if (scalar(@flag_ids)) {
|
||||||
# No reference to existing flags should exist when creating a new
|
# No reference to existing flags should exist when creating a new
|
||||||
# attachment.
|
# attachment.
|
||||||
|
@ -315,6 +304,11 @@ sub validate {
|
||||||
my $flag_type = new Bugzilla::FlagType($id);
|
my $flag_type = new Bugzilla::FlagType($id);
|
||||||
$flag_type || ThrowCodeError('flag_type_nonexistent', { id => $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,
|
_validate(undef, $flag_type, $status, \@requestees, $private_attachment,
|
||||||
$bug_id, $attach_id);
|
$bug_id, $attach_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,8 +223,9 @@
|
||||||
is invalid.
|
is invalid.
|
||||||
|
|
||||||
[% ELSIF error == "flag_type_inactive" %]
|
[% ELSIF error == "flag_type_inactive" %]
|
||||||
[% title = "Inactive Flag Types" %]
|
[% title = "Inactive Flag Type" %]
|
||||||
Some flag types are inactive and cannot be used to create new flags.
|
The flag type [% type FILTER html %] is inactive and cannot be used
|
||||||
|
to create new flags.
|
||||||
|
|
||||||
[% ELSIF error == "flag_type_nonexistent" %]
|
[% ELSIF error == "flag_type_nonexistent" %]
|
||||||
There is no flag type with the ID <em>[% id FILTER html %]</em>.
|
There is no flag type with the ID <em>[% id FILTER html %]</em>.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче