summaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-10-16 16:50:48 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-10-16 16:50:48 +0200
commitd70f291452823c23cef444e8562bba97c5ac8cd7 (patch)
treed0ac04ab2eadf6a2b0b7d769b185493f45be2b43 /enter_bug.cgi
parent02a2238d82a33ed07f46f25db2ef2204cef638d7 (diff)
downloadbugzilla-d70f291452823c23cef444e8562bba97c5ac8cd7.tar.gz
bugzilla-d70f291452823c23cef444e8562bba97c5ac8cd7.tar.xz
Bug 1083790: Default version does not take into account is_active
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi13
1 files changed, 10 insertions, 3 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index f0c86b9ee..171b4566f 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -202,9 +202,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;