diff options
author | Simon Green <sgreen@redhat.com> | 2014-01-02 23:11:04 +0100 |
---|---|---|
committer | Simon Green <sgreen@redhat.com> | 2014-01-02 23:11:04 +0100 |
commit | 8c1cdef6abdd4dabc768760f182067402da09145 (patch) | |
tree | f042563e7522a8ff51fd62f0a1d2ee239298bea2 /enter_bug.cgi | |
parent | 44e26f0615c237fa6759bc23845a96d773e0cba1 (diff) | |
download | bugzilla-8c1cdef6abdd4dabc768760f182067402da09145.tar.gz bugzilla-8c1cdef6abdd4dabc768760f182067402da09145.tar.xz |
Bug 940010 - When entering a new bug, if there's only one active version or component, automatically select it
r=LpSolit, a=sgreen
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-x | enter_bug.cgi | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi index a609a2b9a..1769b464c 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -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; |