]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 371286: Ignore deleted flags - Patch by Frédéric Buclin <LpSolit@gmail.com...
authorlpsolit%gmail.com <>
Sat, 24 Feb 2007 03:19:24 +0000 (03:19 +0000)
committerlpsolit%gmail.com <>
Sat, 24 Feb 2007 03:19:24 +0000 (03:19 +0000)
Bugzilla/Flag.pm
template/en/default/global/code-error.html.tmpl

index 1e47993148212a41aa5ee224fa102ad2abb7d3cd..c3981d92bb0d7b279ec26550f8d1e66be34f7e97 100644 (file)
@@ -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);
index c1d5f799bbb87a14e32574c5ab2994fe56afcc83..2de8bd6a26c152dcdc2286a4af4ea8897a2267ec 100644 (file)
     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" %]