}
# Get a list of actual products, based on list of ids or names
+our %FLAG_CACHE;
sub get {
my ($self, $params) = validate(@_, 'ids', 'names', 'type');
my $user = Bugzilla->user;
}
# Now create a result entry for each.
+ local %FLAG_CACHE = ();
my @products = map { $self->_product_to_hash($params, $_) }
@requested_products;
return { products => \@products };
$field_data->{flag_types} = {
bug =>
[map {
- $self->_flag_type_to_hash($_)
+ $FLAG_CACHE{ $_->id } //= $self->_flag_type_to_hash($_)
} @{$component->flag_types->{'bug'}}],
attachment =>
[map {
- $self->_flag_type_to_hash($_)
+ $FLAG_CACHE{ $_->id } //= $self->_flag_type_to_hash($_)
} @{$component->flag_types->{'attachment'}}],
};
}
}
sub _flag_type_to_hash {
- my ($self, $flag_type, $params) = @_;
- return filter $params, {
+ my ($self, $flag_type) = @_;
+ return {
id =>
$self->type('int', $flag_type->id),
name =>
$self->type('int', $flag_type->grant_group_id),
request_group =>
$self->type('int', $flag_type->request_group_id),
- }, undef, 'flag_types';
+ };
}
sub _version_to_hash {