Bugzilla – Attachment 195007 Details for
Bug 42011
Unused arguments in members/readingrec.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 42011: Fix checkouts search in readingrec.pl
Bug-42011-Fix-checkouts-search-in-readingrecpl.patch (text/plain), 2.10 KB, created by
Baptiste Wojtkowski (bwoj)
on 2026-03-09 15:01:59 UTC
(
hide
)
Description:
Bug 42011: Fix checkouts search in readingrec.pl
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2026-03-09 15:01:59 UTC
Size:
2.10 KB
patch
obsolete
>From cd1dbe4894fe54bf926419d6e119488da2b2388a Mon Sep 17 00:00:00 2001 >From: Baptiste <baptiste.wojtkowski@biblibre.com> >Date: Mon, 9 Mar 2026 15:43:10 +0100 >Subject: [PATCH] Bug 42011: Fix checkouts search in readingrec.pl > >Test plan: >1 - Run perl script provided hereafter >2 - Apply first patch. Notice there is a lot of checkouts >3 - Apply second patch, notice you can see only 2 searches > >Script: >use C4::Circulation qw( AddIssue AddReturn ); >use Koha::Items; >use Koha::Patrons; >use t::lib::Mocks; >use Koha::DateUtils qw(dt_from_string); >my $patron = Koha::Patrons->find(51); >t::lib::Mocks::mock_userenv({patron => $patron}); >my $items = Koha::Items->search; >my $patron_unblessed = $patron->unblessed; >my $i = 0; >my $item = $items->next ; >while ( 1 ) { > my $due = dt_from_string->subtract(days => 45 + rand(45))->set_hour(23)->set_minute(59)->set_second(00); > AddIssue($patron, $item->barcode, $due); > last if ++$i >= 10; > AddReturn($item->barcode, 'CPL'); >} >--- > members/readingrec.pl | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/members/readingrec.pl b/members/readingrec.pl >index 6cbb2672c56..d403745f544 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -91,10 +91,10 @@ if ( $patron->is_anonymous ) { > } else { > $template->param( > checkouts => [ >- $patron->checkouts( >+ $patron->checkouts->search( > {}, > { >- order_by => 'date_due desc', >+ order_by => { -desc => 'date_due' }, > prefetch => { item => { biblio => 'biblioitems' } }, > rows => 1, > } >@@ -103,10 +103,10 @@ if ( $patron->is_anonymous ) { > ); > $template->param( > old_checkouts => [ >- $patron->old_checkouts( >+ $patron->old_checkouts->search( > {}, > { >- order_by => 'date_due desc', >+ order_by => { -desc => 'date_due' }, > prefetch => { item => { biblio => 'biblioitems' } }, > rows => 1, > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 42011
:
195006
| 195007