Commit 509189f0 authored by Tiago Mello's avatar Tiago Mello

Bug 595569: Fixes Bugzilla::Field::ChoiceInterface->controls_visibility_of_fields

method which was causing an error when deleting a product/component. r/a=mkanat
parent 7c03516e
......@@ -110,10 +110,21 @@ sub is_static {
sub controls_visibility_of_fields {
my $self = shift;
$self->{controls_visibility_of_fields} ||= Bugzilla::Field->match(
{ visibility_field_id => $self->field->id,
visibility_value_id => $self->id });
return $self->{controls_visibility_of_fields};
my $dbh = Bugzilla->dbh;
if (!$self->{controls_visibility_of_fields}) {
my $ids = $dbh->selectcol_arrayref(
"SELECT id FROM fielddefs
INNER JOIN field_visibility
ON fielddefs.id = field_visibility.field_id
WHERE value_id = ? AND visibility_field_id = ?", undef,
$self->id, $self->field->id);
$self->{controls_visibility_of_fields} =
Bugzilla::Field->new_from_list($ids);
}
return $self->{controls_visibility_of_fields};
}
sub visibility_value {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment