summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorjouni%heikniemi.net <>2004-07-23 14:09:00 +0200
committerjouni%heikniemi.net <>2004-07-23 14:09:00 +0200
commit7008297c6551e24d20f6c5587c9b350484e624b6 (patch)
tree092b95848b106f8834c16725784157e858dea2d9 /buglist.cgi
parente1b2dccb2b8a336d8e0d4def899fdc54735d76be (diff)
downloadbugzilla-7008297c6551e24d20f6c5587c9b350484e624b6.tar.gz
bugzilla-7008297c6551e24d20f6c5587c9b350484e624b6.tar.xz
Bug 252329: Returning to buglist after an empty fulltext search causes code error
r=kiko, a=justdave ----------------------------------------------------------------------
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi14
1 files changed, 11 insertions, 3 deletions
diff --git a/buglist.cgi b/buglist.cgi
index b9fc8a52c..7e5e27a43 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -591,9 +591,17 @@ my @selectnames = map($columns->{$_}->{'name'}, @selectcolumns);
################################################################################
# Add to the query some instructions for sorting the bug list.
-if ($cgi->cookie('LASTORDER') && (!$order || $order =~ /^reuse/i)) {
- $order = $cgi->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 ($cgi->cookie('LASTORDER')) {
+ $order = $cgi->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