From 37ca03479c2c3cfb04fc15214176f92bca2b6551 Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Wed, 30 Sep 2009 15:33:05 -0600 Subject: [PATCH] bugfix: pagination bar has an empty page at the end 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 +- labels/pcard-member-search.pl | 2 +- members/member.pl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index d80acc4ff9..1eb58b07d3 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/labels/pcard-member-search.pl b/labels/pcard-member-search.pl index 1ff5cf1bb0..3842bd0a82 100755 --- a/labels/pcard-member-search.pl +++ b/labels/pcard-member-search.pl @@ -141,7 +141,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, diff --git a/members/member.pl b/members/member.pl index 6d42b450c2..13daa0d586 100755 --- a/members/member.pl +++ b/members/member.pl @@ -138,7 +138,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, -- 2.39.5