Commit 8c1cdef6 authored by Simon Green's avatar Simon Green

Bug 940010 - When entering a new bug, if there's only one active version or…

Bug 940010 - When entering a new bug, if there's only one active version or component, automatically select it r=LpSolit, a=sgreen
parent 44e26f06
......@@ -149,9 +149,16 @@ if ($cloned_bug_id) {
$cloned_bug_id = $cloned_bug->id;
}
if (scalar(@{$product->components}) == 1) {
# Only one component; just pick it.
$cgi->param('component', $product->components->[0]->name);
# If there is only one active component, choose it
my @active = grep { $_->is_active } @{$product->components};
if (scalar(@active) == 1) {
$cgi->param('component', $active[0]->name);
}
# If there is only one active version, choose it
@active = grep { $_->is_active } @{$product->versions};
if (scalar(@active) == 1) {
$cgi->param('version', $active[0]->name);
}
my %default;
......
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