if ($params) {
$cache_id .= ($params->{product} ? '_p' . $params->{product}->id : '') .
($params->{component} ? '_c' . $params->{component}->id : '');
+ $cache_id .= ':noext' if $params->{skip_extensions};
}
if (!exists $class->request_cache->{$cache_id}) {
- my $fields = Bugzilla::Field->match({ custom => 1, obsolete => 0});
- @$fields = grep($_->type ne FIELD_TYPE_EXTENSION, @$fields);
+ my $fields = Bugzilla::Field->match({ custom => 1, obsolete => 0, skip_extensions => 1 });
Bugzilla::Hook::process('active_custom_fields',
{ fields => \$fields, params => $params });
$class->request_cache->{$cache_id} = $fields;
# This is a sub because it needs to call other subroutines.
sub DB_COLUMNS {
my $dbh = Bugzilla->dbh;
- my @custom = grep {$_->type != FIELD_TYPE_MULTI_SELECT
- && $_->type != FIELD_TYPE_EXTENSION}
- Bugzilla->active_custom_fields;
+ my @custom = grep {$_->type != FIELD_TYPE_MULTI_SELECT }
+ Bugzilla->active_custom_fields({skip_extensions => 1});
my @custom_names = map {$_->name} @custom;
my @columns = (qw(
};
sub UPDATE_COLUMNS {
- my @custom = grep {$_->type != FIELD_TYPE_MULTI_SELECT
- && $_->type != FIELD_TYPE_EXTENSION}
- Bugzilla->active_custom_fields;
+ my @custom = grep {$_->type != FIELD_TYPE_MULTI_SELECT }
+ Bugzilla->active_custom_fields({skip_extensions => 1});
my @custom_names = map {$_->name} @custom;
my @columns = qw(
alias
if (delete $params->{is_select}) {
$params->{type} = [FIELD_TYPE_SINGLE_SELECT, FIELD_TYPE_MULTI_SELECT];
}
+ if (delete $params->{skip_extensions}) {
+ $params->{WHERE}{'type != ?'} = FIELD_TYPE_EXTENSION;
+ }
return $self->SUPER::match(@_);
}
my $product = $params->{'product'};
my $component = $params->{'component'};
+ return if $params->{skip_extensions};
# Create a hash of current fields based on field names
my %field_hash = map { $_->name => $_ } @$$fields;