diff options
author | lpsolit%gmail.com <> | 2007-02-24 03:19:24 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-02-24 03:19:24 +0000 |
commit | bc84c5a4f99c70556beac98b505c12b7c9a5c484 (patch) | |
tree | 626c679f622ec970c36f89f4bf35c65d922dc30f | |
parent | Bug 349423: Release Notes for Bugzilla 3.0 (diff) | |
download | bugzilla-bc84c5a4f99c70556beac98b505c12b7c9a5c484.tar.gz bugzilla-bc84c5a4f99c70556beac98b505c12b7c9a5c484.tar.bz2 bugzilla-bc84c5a4f99c70556beac98b505c12b7c9a5c484.zip |
Bug 371286: Ignore deleted flags - Patch by Frédéric Buclin <LpSolit@gmail.com> r=myk a=LpSolit
-rw-r--r-- | Bugzilla/Flag.pm | 10 | ||||
-rw-r--r-- | template/en/default/global/code-error.html.tmpl | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 1e4799314..c3981d92b 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -317,9 +317,10 @@ sub validate { # Don't bother validating types the user didn't touch. 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); - $flag_type || ThrowCodeError('flag_type_nonexistent', { id => $id }); + next unless $flag_type; # Make sure the flag type is active. unless ($flag_type->is_active) { @@ -336,9 +337,10 @@ sub validate { my @requestees = $cgi->param("requestee-$id"); 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); - $flag || ThrowCodeError("flag_nonexistent", { id => $id }); + next unless $flag; _validate($flag, $flag->type, $status, undef, \@requestees, $private_attachment, undef, undef, $skip_requestee_on_error); diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index c1d5f799b..2de8bd6a2 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -218,9 +218,6 @@ is attached to [% terms.bug %] [%+ attach_bug_id FILTER html %], but you tried to flag it as obsolete while creating a new attachment to [% 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" %] [% title = "Flag Editing not Allowed" %] |