# 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");
$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",
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>.