summaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-06-11 22:32:01 +0200
committerbbaetz%student.usyd.edu.au <>2002-06-11 22:32:01 +0200
commit901cdb792bd4a554ad68b3f92952953b5bff2059 (patch)
treeecf023fb5f039f9c7aa27e9a61977a845c053e78 /enter_bug.cgi
parentf0f65e3728bfbcb82564a4cc1b633312ab35245c (diff)
downloadbugzilla-901cdb792bd4a554ad68b3f92952953b5bff2059.tar.gz
bugzilla-901cdb792bd4a554ad68b3f92952953b5bff2059.tar.xz
Bug 150802 - default version for bug entry not read from cookies
r=jouni x2
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi10
1 files changed, 8 insertions, 2 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index b5d9a66f9..726179722 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -300,10 +300,16 @@ $default{'rep_platform'} = pickplatform();
$vars->{'op_sys'} = \@legal_opsys;
$default{'op_sys'} = pickos();
-# Default version is the last one in the list (hopefully the latest one).
+# Posting a bug sets a cookie for the current version, if one exists. Else,
+# the default version is the last one in the list (hopefully the latest one).
# Eventually maybe each product should have a "current version" parameter.
$vars->{'version'} = $::versions{$product} || [];
-$default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
+if (exists $::COOKIE{"VERSION-$product"} &&
+ lsearch($vars->{'version'}, $::COOKIE{"VERSION-$product"}) != -1) {
+ $default{'version'} = $::COOKIE{"VERSION-$product"};
+} else {
+ $default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
+}
# There must be at least one status in @status.
my @status = "NEW";