Add warning for unrecognized sort order.
authorJoe Atzberger <joe.atzberger@liblime.com>
Wed, 18 Mar 2009 22:21:47 +0000 (17:21 -0500)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 6 Apr 2009 16:01:35 +0000 (11:01 -0500)
This may help elucidate problems we are having with sorts that
do not seem to work.  I.E., if the inteface is requesting
unrecognized sort orders, we need to know about it.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Search.pm

index 59d0a08..f1b68b5 100644 (file)
@@ -331,8 +331,7 @@ sub getRecords {
     my $facets_info    = ();
     my $facets         = getFacets();
 
-    my @facets_loop
-      ;    # stores the ref to array of hashes for template facets loop
+    my @facets_loop;    # stores the ref to array of hashes for template facets loop
 
     ### LOOP THROUGH THE SERVERS
     for ( my $i = 0 ; $i < @servers ; $i++ ) {
@@ -427,6 +426,9 @@ sub getRecords {
             elsif ( $sort eq "title_za" ) {
                 $sort_by .= "1=4 >i ";
             }
+            else {
+                warn "Ignoring unrecognized sort '$sort' requested";
+            }
         }
         if ($sort_by) {
             if ( $results[$i]->sort( "yaz", $sort_by ) < 0 ) {
@@ -625,7 +627,7 @@ sub pazGetRecords {
     my $paz = C4::Search::PazPar2->new(C4::Context->config('pazpar2url'));
     $paz->init();
     $paz->search($simple_query);
-    sleep 1;
+    sleep 1;   # FIXME: WHY?
 
     # do results
     my $results_hashref = {};