Bug 20261: Fix pagination of the results in authority search
authorAlex Arnaud <alex.arnaud@gmail.com>
Wed, 28 Mar 2018 09:03:56 +0000 (09:03 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 5 Apr 2018 17:17:30 +0000 (14:17 -0300)
Test plan:

  - apply this patch,
  - do a search that return more than 20 results,
  - click on page 2,
  - check that you get results,
  - check other pages if possible

Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

authorities/authorities-home.pl

index 89142f2..7c46794 100755 (executable)
@@ -94,18 +94,9 @@ if ( $op eq "do_search" ) {
         [$marclist], [$and_or], [$excluding], [$operator],
         [$value], $authtypecode, $orderby
     );
-    my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
-    my ( $results, $total ) =
-      $searcher->search_auth_compat( $search_query, $offset,
-        $resultsperpage );
-    #my ( $results, $total ) = SearchAuthorities(
-    #    [$marclist],  [$and_or],
-    #    [$excluding], [$operator],
-    #    [$value], ( $startfrom - 1 ) * $resultsperpage,
-    #    $resultsperpage, $authtypecode,
-    #    $orderby
-    #);
-
+    my ( $results, $total ) = $searcher->search_auth_compat(
+        $search_query, $startfrom, $resultsperpage
+    );
 
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {