]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 252329: Returning to buglist after an empty fulltext search causes code error
authorjouni%heikniemi.net <>
Fri, 23 Jul 2004 12:07:24 +0000 (12:07 +0000)
committerjouni%heikniemi.net <>
Fri, 23 Jul 2004 12:07:24 +0000 (12:07 +0000)
r=kiko, a=justdave

buglist.cgi

index 28993cbec2b5d987e97684a29fc2de1ce3e90d95..1e71d5238ee14b09f4856e0bd06842fd4ba5146d 100755 (executable)
@@ -591,9 +591,17 @@ my @selectnames = map($columns->{$_}->{'name'}, @selectcolumns);
 ################################################################################
 
 # Add to the query some instructions for sorting the bug list.
-if ($::COOKIE{'LASTORDER'} && (!$order || $order =~ /^reuse/i)) {
-    $order = $::COOKIE{'LASTORDER'};
-    $order_from_cookie = 1;
+
+# First check if we'll want to reuse the last sorting order; that happens if
+# the order is not defined or its value is "reuse last sort"
+if (!$order || $order =~ /^reuse/i) {
+    if ($::COOKIE{'LASTORDER'}) {
+      $order = $::COOKIE{'LASTORDER'};
+      $order_from_cookie = 1;
+    }
+    else {
+      $order = '';  # Remove possible "reuse" identifier as unnecessary
+    }
 }
 
 my $db_order = "";  # Modified version of $order for use with SQL query