Commit bc84c5a4 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 371286: Ignore deleted flags - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=myk a=LpSolit

parent fa306daf
...@@ -317,9 +317,10 @@ sub validate { ...@@ -317,9 +317,10 @@ sub validate {
# Don't bother validating types the user didn't touch. # Don't bother validating types the user didn't touch.
next if $status eq 'X'; next if $status eq 'X';
# Make sure the flag type exists. # Make sure the flag type exists. If it doesn't, FormToNewFlags()
# will ignore it, so it's safe to ignore it here.
my $flag_type = new Bugzilla::FlagType($id); my $flag_type = new Bugzilla::FlagType($id);
$flag_type || ThrowCodeError('flag_type_nonexistent', { id => $id }); next unless $flag_type;
# Make sure the flag type is active. # Make sure the flag type is active.
unless ($flag_type->is_active) { unless ($flag_type->is_active) {
...@@ -336,9 +337,10 @@ sub validate { ...@@ -336,9 +337,10 @@ sub validate {
my @requestees = $cgi->param("requestee-$id"); my @requestees = $cgi->param("requestee-$id");
my $private_attachment = $cgi->param('isprivate') ? 1 : 0; my $private_attachment = $cgi->param('isprivate') ? 1 : 0;
# Make sure the flag exists. # Make sure the flag exists. If it doesn't, process() will ignore it,
# so it's safe to ignore it here.
my $flag = new Bugzilla::Flag($id); my $flag = new Bugzilla::Flag($id);
$flag || ThrowCodeError("flag_nonexistent", { id => $id }); next unless $flag;
_validate($flag, $flag->type, $status, undef, \@requestees, $private_attachment, _validate($flag, $flag->type, $status, undef, \@requestees, $private_attachment,
undef, undef, $skip_requestee_on_error); undef, undef, $skip_requestee_on_error);
......
...@@ -218,9 +218,6 @@ ...@@ -218,9 +218,6 @@
is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %], is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %],
but you tried to flag it as obsolete while creating a new attachment to but you tried to flag it as obsolete while creating a new attachment to
[% terms.bug %] [%+ my_bug_id FILTER html %]. [% terms.bug %] [%+ my_bug_id FILTER html %].
[% ELSIF error == "flag_nonexistent" %]
There is no flag with ID #[% id FILTER html %].
[% ELSIF error == "flags_not_available" %] [% ELSIF error == "flags_not_available" %]
[% title = "Flag Editing not Allowed" %] [% title = "Flag Editing not Allowed" %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment