From 9b42e6d92add7dd0b1595ff6788ca70c22e6480e Mon Sep 17 00:00:00 2001 From: iliajie Date: Wed, 10 May 2023 10:50:03 +0300 Subject: [PATCH] Fix to use caller's pagination number if any --- ui-lib.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui-lib.pl b/ui-lib.pl index 0727fbbd2..89255f998 100755 --- a/ui-lib.pl +++ b/ui-lib.pl @@ -2861,6 +2861,12 @@ if (ref($arr) eq 'ARRAY' && $arr->[0]) { (int($ENV{'HTTP_X_CLIENT_HEIGHT'}) || (int($opts->{'client_height'}) ? ((int($opts->{'client_height'} - 77 - 70) / 26)) : $items_per_page)); + # If caller wants specific pagination number, + # e.g. a module config, use that instead + if ($exported_form && $exported_form->{'paginate'}) { + $items_per_page = $exported_form->{'paginate'}; + } + # Pagination my $totals_items_original = scalar(@arr); my $total_pages = ceil(($totals_items_original) / $items_per_page);