Plugin for field 124e
[koha.git] / C4 / Authorities.pm
index e346e26..8af184b 100644 (file)
@@ -192,9 +192,9 @@ sub searchauthority  {
                push(@bind,$searchstring);
                }
 #      $query .= " and freelib like \"$searchstring%\"" if ($searchstring);
-       $query .= " order by category,freelib limit ?,?";
+       $query .= " limit ?,?";
        push(@bind,$offset,($pagesize*4));
-#      warn "q : $query";
+       warn "q : $query".@bind;
        my $sth=$dbh->prepare($query);
        $sth->execute(@bind);
        my @results;
@@ -218,7 +218,7 @@ sub searchauthority  {
        my ($cnt) = $sth->fetchrow;
        $cnt = $pagesize+1 if ($cnt>$pagesize);
        $sth->finish();
-       return ($cnt,\@results);
+       return ($#results,\@results);
 }
 
 =item SearchDeeper