From 4cf75c0c41095852b1dde1ab951c899f6619bb9b 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 --- 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 4fe1622bc12..5243872c734 100755 --- a/opac/opac-readingrecord.pl +++ b/opac/opac-readingrecord.pl @@ -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 ]; -- 2.39.5