diff --git a/webtools/bugzilla/buglist.cgi b/webtools/bugzilla/buglist.cgi index caf0943128eb..28993cbec2b5 100755 --- a/webtools/bugzilla/buglist.cgi +++ b/webtools/bugzilla/buglist.cgi @@ -875,7 +875,8 @@ if ($dotweak) { $vars->{'dotweak'} = 1; $vars->{'use_keywords'} = 1 if @::legal_keywords; - $vars->{'products'} = \@::legal_product; + my @enterable_products = GetEnterableProducts(); + $vars->{'products'} = \@enterable_products; $vars->{'platforms'} = \@::legal_platform; $vars->{'priorities'} = \@::legal_priority; $vars->{'severities'} = \@::legal_severity; diff --git a/webtools/bugzilla/globals.pl b/webtools/bugzilla/globals.pl index a2172a998e02..6632833abd2a 100644 --- a/webtools/bugzilla/globals.pl +++ b/webtools/bugzilla/globals.pl @@ -516,6 +516,17 @@ sub CanEnterProduct { return ($ret); } +sub GetEnterableProducts { + my @products; + # XXX rewrite into pure SQL instead of relying on legal_products? + foreach my $p (@::legal_product) { + if (CanEnterProduct($p)) { + push @products, $p; + } + } + return (@products); +} + # # This function returns an alphabetical list of product names to which # the user can enter bugs. If the $by_id parameter is true, also retrieves IDs