Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ __lbheartbeat__

/skins/contrib/Dusk/admin.css
/skins/contrib/Dusk/bug.css
.vstags
2 changes: 1 addition & 1 deletion Bugzilla/WebService/Bug.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ sub _bug_to_hash {
{
product => $bug->product_obj,
component => $bug->component_obj,
bug_id => $bug->id
bug => $bug
},
$self->wants_object,
);
Expand Down
13 changes: 12 additions & 1 deletion extensions/BMO/Extension.pm
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ sub active_custom_fields {
my $params = $args->{'params'};
my $product = $params->{'product'};
my $component = $params->{'component'};
my $bug = $params->{'bug'};

return if !$product;

Expand All @@ -449,7 +450,7 @@ sub active_custom_fields {

my @tmp_fields;
foreach my $field (@$$fields) {
next if cf_hidden_in_product($field->name, $product_name, $component_name);
next if cf_hidden_in_product($field->name, $product_name, $component_name, $bug);
push(@tmp_fields, $field);
}
$$fields = \@tmp_fields;
Expand All @@ -458,6 +459,16 @@ sub active_custom_fields {
sub cf_hidden_in_product {
my ($field_name, $product_name, $component_name, $bug) = @_;

# Show field if a value has been set
my $value;
if (blessed($bug) && $bug->can($field_name)) {
$value = $bug->$field_name;
}
else {
$value = $bug->{$field_name};
}
return 0 if $value && $value ne '---';

# check Bugzilla's built-in visibility controls first
if ($bug) {
my $field = Bugzilla::Field->new({name => $field_name, cache => 1});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
];

# all custom fields
custom_fields = Bugzilla.active_custom_fields(product => bug.product_obj, component => bug.component_obj, bug_id => bug.id);
custom_fields = Bugzilla.active_custom_fields(product => bug.product_obj, component => bug.component_obj, bug => bug);

# extract needinfo flags
needinfo = [];
Expand Down
2 changes: 1 addition & 1 deletion extensions/Ember/lib/WebService.pm
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ sub _get_fields {
# Load custom fields
my $cf_params = {product => $bug->product_obj};
$cf_params->{component} = $bug->component_obj if $bug->can('component_obj');
$cf_params->{bug_id} = $bug->id if $bug->id;
$cf_params->{bug} = $bug if $bug;
push(@field_objs, Bugzilla->active_custom_fields($cf_params));
}

Expand Down
2 changes: 2 additions & 0 deletions extensions/TrackingFlags/lib/Flag.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ sub match {

# Use later for preload
my $bug_id = delete $params->{'bug_id'};
my $bug = delete $params->{'bug'};
$bug_id = $bug->id if $bug;

# Retrieve all flags relevant for the given product and component
if (
Expand Down
2 changes: 1 addition & 1 deletion template/en/default/bug/show-multiple.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@

[% USE Bugzilla %]
[% field_counter = 0 %]
[% FOREACH field = Bugzilla.active_custom_fields(product=>bug.product_obj,component=>bug.component_obj,bug_id=>bug.id) %]
[% FOREACH field = Bugzilla.active_custom_fields(product=>bug.product_obj,component=>bug.component_obj,bug=>bug) %]
[% field_counter = field_counter + 1 %]
[%# Odd-numbered fields get an opening <tr> %]
[% '<tr>' IF field_counter % 2 %]
Expand Down