Bug 38102: Fix limit to 50 items in the checkout history - OPAC

Checkout history does not limit to 50 items, it's a regression from bug
33949.

To limit to 50 items we need to use "rows", not "limit".

Test plan:
Have more than 50 checkouts and confirm that by default the table only
displays 50 entries.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit dd28d473cd)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit ef5e67a6ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2025-07-10 09:51:32 +02:00 committed by Fridolin Somers
parent 918a22b5c8
commit ff92a34ca5
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 4 additions and 4 deletions

View File

@ -72,23 +72,23 @@ $limit //= '';
$limit = ( $limit eq 'full' ) ? 0 : 50;
my $checkouts = [
$patron->checkouts(
$patron->checkouts->search(
{},
{
order_by => $order,
prefetch => { item => { biblio => 'biblioitems' } },
( $limit ? ( limit => $limit ) : () ),
( $limit ? ( rows => $limit ) : () ),
}
)->as_list
];
$limit -= scalar(@$checkouts) if $limit;
my $old_checkouts = [
$patron->old_checkouts(
$patron->old_checkouts->search(
{},
{
order_by => $order,
prefetch => { item => { biblio => 'biblioitems' } },
( $limit ? ( limit => $limit ) : () ),
( $limit ? ( rows => $limit ) : () ),
}
)->as_list
];