]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 179206 - enter_bug isn't picking up version from URL
authorbbaetz%student.usyd.edu.au <>
Tue, 19 Nov 2002 07:49:18 +0000 (07:49 +0000)
committerbbaetz%student.usyd.edu.au <>
Tue, 19 Nov 2002 07:49:18 +0000 (07:49 +0000)
patch by GavinS <bugzilla@chimpychompy.org>, r=bbaetz
a=justdave

enter_bug.cgi

index 22c016bba9189f1b60a8b2f9fb2d0012659e10ab..5492bb14a918447d16d4edbec82ca0a034f6ad25 100755 (executable)
@@ -281,15 +281,18 @@ $default{'rep_platform'} = pickplatform();
 $vars->{'op_sys'} = \@legal_opsys; 
 $default{'op_sys'} = pickos();
 
-# 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.
+# Use the version specified in the URL, if one is supplied. If not,
+# then use the cookie-specified value. (Posting a bug sets a cookie
+# for the current version.) If no URL or cookie version, 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} || [];
-if (exists $::COOKIE{"VERSION-$product"} &&
+if (formvalue('version')) {
+    $default{'version'} = formvalue('version');
+} elsif (exists $::COOKIE{"VERSION-$product"} &&
     lsearch($vars->{'version'}, $::COOKIE{"VERSION-$product"}) != -1) {
     $default{'version'} = $::COOKIE{"VERSION-$product"};
-} elsif (formvalue('version')) {
-    $default{'version'} = formvalue('version');
 } else {
     $default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
 }