X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ccacef74f97842c0297a735fe7d81987adb5e6d6..54bd1719f9ca8db62ef6a3d766d3965e01833c20:/SL/Controller/Helper/Paginated.pm?ds=sidebyside diff --git a/SL/Controller/Helper/Paginated.pm b/SL/Controller/Helper/Paginated.pm index 11eddd32d..1683aada0 100644 --- a/SL/Controller/Helper/Paginated.pm +++ b/SL/Controller/Helper/Paginated.pm @@ -7,6 +7,8 @@ our @EXPORT = qw(make_paginated get_paginate_spec get_current_paginate_params _s use constant PRIV => '__paginatedhelper_priv'; +use List::Util qw(min); + my %controller_paginate_spec; sub make_paginated { @@ -60,7 +62,8 @@ sub get_current_paginate_params { : (); my $calculated_params = "SL::DB::Manager::$spec->{MODEL}"->paginate(%paginate_params, args => \%paginate_args); %paginate_params = ( - %paginate_params, + page => min($paginate_params{page}, $calculated_params->{max}), + per_page => $paginate_params{per_page}, num_pages => $calculated_params->{max}, common_pages => $calculated_params->{common}, );