[Koha-patches] [PATCH] bugfix: pagination bar has an empty page at the end

Michael Hafen mdhafen at tech.washk12.org
Wed Sep 30 23:35:52 CEST 2009


There are a few pages where the pagination_bar() call produces an empty page
when the number of results is a multiple of the results per page.  Looking at
getnbpages() I see the right way to do it.  So I changed these few pages to
either use getnbpages() or calculate the number of pages the same way.
---
 authorities/authorities-home.pl |    2 +-
 members/member.pl               |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl
index d80acc4..1eb58b0 100755
--- a/authorities/authorities-home.pl
+++ b/authorities/authorities-home.pl
@@ -125,7 +125,7 @@ if ( $op eq "do_search" ) {
 
     $template->param(
         pagination_bar => pagination_bar(
-            $base_url,  int( $total / $resultsperpage ) + 1,
+            $base_url,  getnbpages( $total, $resultsperpage ),
             $startfrom, 'startfrom'
         ),
         total     => $total,
diff --git a/members/member.pl b/members/member.pl
index fcc6ee1..4b5528c 100755
--- a/members/member.pl
+++ b/members/member.pl
@@ -136,7 +136,7 @@ my $base_url =
 
 $template->param(
     paginationbar => pagination_bar(
-        $base_url,  int( $count / $resultsperpage ) + 1,
+        $base_url,  int( ($count - 1) / $resultsperpage ) + 1,
         $startfrom, 'startfrom'
     ),
     startfrom => $startfrom,
-- 
1.6.0.4




More information about the Koha-patches mailing list