Bug 20287: Move fixup_cardnumber
[koha.git] / opac / opac-authorities-home.pl
index 5b1a42b..4dcb33c 100755 (executable)
@@ -64,8 +64,9 @@ if ( $op eq "do_search" ) {
         { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
     my $search_query = $builder->build_authorities_query_compat( \@marclist, \@and_or,
         \@excluding, \@operator, \@value, $authtypecode, $orderby );
+    my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
     my ( $results, $total ) =
-      $searcher->search_auth_compat( $search_query, $startfrom, $resultsperpage );
+      $searcher->search_auth_compat( $search_query, $offset, $resultsperpage );
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
             template_name   => "opac-authoritiessearchresultlist.tt",
@@ -123,7 +124,7 @@ if ( $op eq "do_search" ) {
 
     # Opac search history
     if (C4::Context->preference('EnableOpacSearchHistory')) {
-        unless ( $startfrom ) {
+        if ( $startfrom == 1) {
             my $path_info = $query->url(-path_info=>1);
             my $query_cgi_history = $query->url(-query=>1);
             $query_cgi_history =~ s/^$path_info\?//;