diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2016-01-04 23:51:02 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2016-01-04 23:51:02 +0100 |
commit | 04004a62e2f190d6cfb3bd6965e9054125b56c47 (patch) | |
tree | 234c294322e9a63174a462d430d7f2e1e5e74200 /request.cgi | |
parent | Bug 1235395 - whine.pl broken due to a missing generate_email() routine (diff) | |
download | bugzilla-04004a62e2f190d6cfb3bd6965e9054125b56c47.tar.gz bugzilla-04004a62e2f190d6cfb3bd6965e9054125b56c47.tar.bz2 bugzilla-04004a62e2f190d6cfb3bd6965e9054125b56c47.zip |
Bug 1191706: When editing flag types, components do not match the selected product when classifications are enabled
r/a=dkl
Diffstat (limited to 'request.cgi')
-rwxr-xr-x | request.cgi | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/request.cgi b/request.cgi index 566781a0c..347cb7a44 100755 --- a/request.cgi +++ b/request.cgi @@ -305,13 +305,22 @@ sub queue { $vars->{'requests'} = \@requests; $vars->{'types'} = \@types; - my %components; - foreach my $prod (@{$user->get_selectable_products}) { - foreach my $comp (@{$prod->components}) { - $components{$comp->name} = 1; + # This code is needed to populate the Product and Component select fields. + my ($products, %components); + if (Bugzilla->params->{useclassification}) { + foreach my $class (@{$user->get_selectable_classifications}) { + push @$products, @{$user->get_selectable_products($class->id)}; } } - $vars->{'components'} = [ sort { $a cmp $b } keys %components ]; + else { + $products = $user->get_selectable_products; + } + + foreach my $product (@$products) { + $components{$_->name} = 1 foreach @{$product->components}; + } + $vars->{'products'} = $products; + $vars->{'components'} = [ sort keys %components ]; $vars->{'urlquerypart'} = $cgi->canonicalise_query('ctype'); |