diff options
Diffstat (limited to 'Bugzilla/Component.pm')
-rw-r--r-- | Bugzilla/Component.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 2a176f5dc..dc3cc1b9e 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -374,16 +374,14 @@ sub flag_types { my $self = shift; if (!defined $self->{'flag_types'}) { + my $flagtypes = Bugzilla::FlagType::match({ product_id => $self->product_id, + component_id => $self->id }); + $self->{'flag_types'} = {}; $self->{'flag_types'}->{'bug'} = - Bugzilla::FlagType::match({ 'target_type' => 'bug', - 'product_id' => $self->product_id, - 'component_id' => $self->id }); - + [grep { $_->target_type eq 'bug' } @$flagtypes]; $self->{'flag_types'}->{'attachment'} = - Bugzilla::FlagType::match({ 'target_type' => 'attachment', - 'product_id' => $self->product_id, - 'component_id' => $self->id }); + [grep { $_->target_type eq 'attachment' } @$flagtypes]; } return $self->{'flag_types'}; } |