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>
This commit is contained in:
Jonathan Druart 2025-07-10 09:51:32 +02:00 committed by Lucas Gass
parent afa1cfb63a
commit dd28d473cd
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 4 additions and 4 deletions

View File

@ -66,23 +66,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
];