]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 345958: Do not throw an error if an inactive flag type is set to "X" while editin...
authorlpsolit%gmail.com <>
Fri, 25 Aug 2006 04:49:38 +0000 (04:49 +0000)
committerlpsolit%gmail.com <>
Fri, 25 Aug 2006 04:49:38 +0000 (04:49 +0000)
Bugzilla/FlagType.pm
template/en/default/global/code-error.html.tmpl

index 8b2202147c6df03223c5cdab00e109dd9881e0fb..6a525fd0e1d2caa0e49dd56a2b83595c1e32939d 100644 (file)
@@ -344,15 +344,6 @@ sub validate {
     # this bug/attachment. This check will be done later when
     # processing new flags, see Flag::FormToNewFlags().
 
-    # All flag types have to be active
-    my $inactive_flagtypes =
-        $dbh->selectrow_array("SELECT 1 FROM flagtypes
-                               WHERE id IN (" . join(',', @ids) . ")
-                               AND is_active = 0 " .
-                               $dbh->sql_limit(1));
-
-    ThrowCodeError("flag_type_inactive") if $inactive_flagtypes;
-
     foreach my $id (@ids) {
         my $status = $cgi->param("flag_type-$id");
         my @requestees = $cgi->param("requestee_type-$id");
@@ -365,6 +356,10 @@ sub validate {
         $flag_type 
           || ThrowCodeError("flag_type_nonexistent", { id => $id });
 
+        # Make sure the flag type is active.
+        $flag_type->{'is_active'}
+          || ThrowCodeError('flag_type_inactive', {'type' => $flag_type->{'name'}});
+
         # Make sure the value of the field is a valid status.
         grep($status eq $_, qw(X + - ?))
           || ThrowCodeError("flag_status_invalid", 
index 4b2cc7327698569bcb100900384db7dcfb3b23df..d2b496ca201619704b8a259f323b4003361d5277 100644 (file)
     a positive integer.
 
   [% ELSIF error == "flag_type_inactive" %]
-    [% title = "Inactive Flag Types" %]
-    Some flag types are inactive and cannot be used to create new flags.
+    [% title = "Inactive Flag Type" %]
+    The flag type [% type FILTER html %] is inactive and cannot be used
+    to create new flags.
 
   [% ELSIF error == "flag_type_nonexistent" %]
     There is no flag type with the ID <em>[% id FILTER html %]</em>.