From ff92a34ca5bb1cd0bd6bb7d4544cba5cba6a17da Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 10 Jul 2025 09:51:32 +0200 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize Signed-off-by: Lucas Gass (cherry picked from commit dd28d473cd62b30a3dd996fe558dec5cd19c5c13) Signed-off-by: Paul Derscheid (cherry picked from commit ef5e67a6ce04b66cd1283aecb68914faf3b5812f) Signed-off-by: Fridolin Somers --- opac/opac-readingrecord.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opac/opac-readingrecord.pl b/opac/opac-readingrecord.pl index a671ca0f01..bee8684ae0 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -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 ];