From 51604b548756fbf74620061a779d0182167c36f3 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Sat, 26 Mar 2011 06:01:51 -0400 Subject: [PATCH] Bug 4393: Scan Indexes results cannot be sorted Because of the way Scan Indexes works, the results cannot be sorted. Previously when any sort other than relevance (or in some cases popularity) was used, the search failed. This patch disables sorting on Scan results. This patch also fixes the index selection dropdown on the results page, which was not being populated correctly from the Advanced Search screen. Signed-off-by: Nicole C. Engard Signed-off-by: Chris Cormack --- C4/Search.pm | 2 +- catalogue/search.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index f618c6a081..f970caf5c2 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -391,7 +391,7 @@ sub getRecords { warn "Ignoring unrecognized sort '$sort' requested" if $sort_by; } } - if ($sort_by) { + if ($sort_by && !$scan) { if ( $results[$i]->sort( "yaz", $sort_by ) < 0 ) { warn "WARNING sort $sort_by failed"; } diff --git a/catalogue/search.pl b/catalogue/search.pl index 968f2a1b2b..b1a0b4fe1d 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -383,7 +383,7 @@ my @indexes; @indexes = split("\0",$params->{'idx'}); # if a simple index (only one) display the index used in the top search box -if ($indexes[0] && !$indexes[1]) { +if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) { $template->param("ms_".$indexes[0] => 1);} -- 2.39.5