summaryrefslogtreecommitdiffstats
path: root/request.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2016-01-04 23:47:11 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2016-01-04 23:47:11 +0100
commitf709156da6e562a4466d45c9422ff0a111aaa7e0 (patch)
tree7c358b7cc4b280176447f16fad3462fff067a446 /request.cgi
parent9f5a8a28783f66b15973ac3714d10d1c0fa05f6d (diff)
downloadbugzilla-f709156da6e562a4466d45c9422ff0a111aaa7e0.tar.gz
bugzilla-f709156da6e562a4466d45c9422ff0a111aaa7e0.tar.xz
Bug 1191706: When editing flag types, components do not match the selected product when classifications are enabled
r=dkl
Diffstat (limited to 'request.cgi')
-rwxr-xr-xrequest.cgi19
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');