diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index a330a904a..db120d97f 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -263,7 +263,7 @@ sub get_all ->{$f->id}; my $visible_ids = { map { $_->id => 1 } Bugzilla::Product->get_all }; my $vis; - my $filtered; + my $filtered = []; for my $value (@$all) { $vis = !$h->{$value->id} || !%{$h->{$value->id}} ? 1 : 0; diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 0e5f088a5..204e65289 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -805,6 +805,10 @@ sub get_selectable_classifications # Return classifications with at least one visible product # + all empty classifications my $products = $self->get_selectable_products; + if (!@$products) + { + return []; + } my $class_ids = Bugzilla->dbh->selectcol_arrayref( "SELECT DISTINCT c.id FROM classifications c". " LEFT JOIN products p ON p.classification_id=c.id".