[Koha-patches] [PATCH] Add warning for unrecognized sort order.

Joe Atzberger joe.atzberger at liblime.com
Wed Mar 18 23:21:47 CET 2009


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.
---
 C4/Search.pm |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/C4/Search.pm b/C4/Search.pm
index e4c6f84..4bba160 100644
--- a/C4/Search.pm
+++ b/C4/Search.pm
@@ -332,8 +332,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++ ) {
@@ -428,6 +427,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 ) {
@@ -612,7 +614,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 = {};
-- 
1.5.6.5



More information about the Koha-patches mailing list