Bug 4393: Scan Indexes results cannot be sorted
authorJared Camins-Esakov <jcamins@bywatersolutions.com>
Sat, 26 Mar 2011 10:01:51 +0000 (06:01 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 30 Mar 2011 06:51:52 +0000 (19:51 +1300)
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 <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Search.pm
catalogue/search.pl

index f618c6a..f970caf 100644 (file)
@@ -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";
             }
index 968f2a1..b1a0b4f 100755 (executable)
@@ -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);}