diff options
author | myk%mozilla.org <> | 2002-11-09 10:58:47 +0100 |
---|---|---|
committer | myk%mozilla.org <> | 2002-11-09 10:58:47 +0100 |
commit | 8816b8cb98a7902b722c00cbed6e22b12f176e74 (patch) | |
tree | b8548c08fa5472df8b22943bd4deda444863f56d /bug_form.pl | |
parent | c39803cc45e621f01e0598c7fb875f5e494ebd14 (diff) | |
download | bugzilla-8816b8cb98a7902b722c00cbed6e22b12f176e74.tar.gz bugzilla-8816b8cb98a7902b722c00cbed6e22b12f176e74.tar.xz |
Fix for bug 171505: shows disabled flags in the UI
r=bbaetz
a=justdave
Diffstat (limited to 'bug_form.pl')
-rw-r--r-- | bug_form.pl | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/bug_form.pl b/bug_form.pl index 0e6b4547d..946dc4a31 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -209,8 +209,7 @@ sub show_bug { my $flag_types = Bugzilla::FlagType::match({ 'target_type' => 'bug', 'product_id' => $bug{'product_id'}, - 'component_id' => $bug{'component_id'}, - 'is_active' => 1 }); + 'component_id' => $bug{'component_id'}); foreach my $flag_type (@$flag_types) { $flag_type->{'flags'} = Bugzilla::Flag::match({ 'bug_id' => $id , @@ -219,13 +218,21 @@ sub show_bug { } $vars->{'flag_types'} = $flag_types; - # The number of types of flags that can be set on attachments - # to this bug. If none, flags won't be shown in the list of attachments. - $vars->{'num_attachment_flag_types'} = - Bugzilla::FlagType::count({ 'target_type' => 'a', - 'product_id' => $bug{'product_id'}, - 'component_id' => $bug{'component_id'}, - 'is_active' => 1 }); + # The number of types of flags that can be set on attachments to this bug + # and the number of flags on those attachments. One of these counts must be + # greater than zero in order for the "flags" column to appear in the table + # of attachments. + my $num_attachment_flag_types = + Bugzilla::FlagType::count({ 'target_type' => 'attachment', + 'product_id' => $bug{'product_id'}, + 'component_id' => $bug{'component_id'}, + 'is_active' => 1 }); + my $num_attachment_flags = + Bugzilla::Flag::count({ 'target_type' => 'attachment', + 'bug_id' => $id }); + + $vars->{'show_attachment_flags'} + = $num_attachment_flag_types || $num_attachment_flags; # Dependencies my @list; |