Commit 5f81c1d6 authored by bugreport%peshkin.net's avatar bugreport%peshkin.net

Bug 311489 Bug entry makes user choose classification even if only one is enterable

Patch bu Joel Peshkin <bugreport@peshkin.net> r=kiko, a=justdave
parent b26634d7
......@@ -76,11 +76,25 @@ if (!defined $product || $product eq "") {
if ( ! Param('useclassification') ) {
# just pick the default one
$cgi->param(-name => 'classification', -value => (keys %::classdesc)[0]);
$cgi->param(-name => 'classification',
-value => (keys %::classdesc)[0]);
}
if (!$cgi->param('classification')) {
my $classifications = Bugzilla->user->get_selectable_classifications();
foreach my $classification (@$classifications) {
my $found = 0;
foreach my $p (@enterable_products) {
if (CanEnterProduct($p)
&& IsInClassification($classification->{name},$p)) {
$found = 1;
}
}
if ($found == 0) {
@$classifications = grep($_->{name} ne $classification->{name},
@$classifications);
}
}
if (scalar(@$classifications) == 0) {
ThrowUserError("no_products");
......
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