From c3e1d798b9d0d79910d46bfd06c21b2cd6750a07 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 7 Aug 2008 22:55:41 +0000 Subject: [PATCH] fixed: paginator doesn't show correct number of page links with a limit applied --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Paginator.pm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 3c49bb64e..3ebdbd8df 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.5.19 + - fixed: paginator doesn't show correct number of page links with a limit applied - fixed: user profile defaults can contain arbitrary perl code - fixed: Syndicated Content UTF-8 check for decoded content - fixed: unable to purge trash diff --git a/lib/WebGUI/Paginator.pm b/lib/WebGUI/Paginator.pm index 108e8edaa..22dce6a96 100644 --- a/lib/WebGUI/Paginator.pm +++ b/lib/WebGUI/Paginator.pm @@ -492,8 +492,8 @@ sub getPageLinks { my $output; my $i = 1; my $minPage = $self->getPageNumber - round($limit/2); - my $maxPage = $minPage + $limit; my $start = ($minPage > 0) ? $minPage : 1; + my $maxPage = $start + $limit - 1; my $end = ($maxPage < $self->getPageNumber) ? $self->getPageNumber : $maxPage; my @temp; foreach my $page (@pages) {