]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 150802 - default version for bug entry not read from cookies
authorbbaetz%student.usyd.edu.au <>
Tue, 11 Jun 2002 20:33:45 +0000 (20:33 +0000)
committerbbaetz%student.usyd.edu.au <>
Tue, 11 Jun 2002 20:33:45 +0000 (20:33 +0000)
r=jouni x2

enter_bug.cgi
post_bug.cgi

index b5d9a66f93f9ef5762378500f8872eae9b35040f..72617972248c9ef623b96012fe8c50e048c042a4 100755 (executable)
@@ -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";
index 5980f714bb4516619b27268d003fb3dc4f5cfc79..42e550fbda93d68000082238ae58f06ec7d67e17 100755 (executable)
@@ -73,9 +73,6 @@ my $product = $::FORM{'product'};
 # Set cookies
 my $cookiepath = Param("cookiepath");
 if (exists $::FORM{'product'}) {
-    print "Set-Cookie: PLATFORM=$product ; path=$cookiepath ; \
-           expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
-    
     if (exists $::FORM{'version'}) {           
         print "Set-Cookie: VERSION-$product=$::FORM{'version'} ; \
                path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";