From 96411ad9d2dfb1db33187a38ec495505a0873227 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 7 Jun 2023 18:03:07 +0000 Subject: [PATCH] Bug 33944: Don't fetch item object unless using recalls To test: 1 - Check someitems out to a patron 2 - View thier checkouts 3 - Apply patch, restart_all 4 - Confirm checkouts load as before 5 - Enable recalls 6 - Recall an item checked out to this patron 7 - Confirm recall shows as expected Signed-off-by: Sam Lau Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 4610bc64eb6d36583ec7533bc2a624241653b0ed) Signed-off-by: Martin Renvoize (cherry picked from commit 9df75ef0cbd987501cdc7e731f03d508862c3afc) Signed-off-by: Pedro Amorim --- svc/checkouts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svc/checkouts b/svc/checkouts index b8e84f4704..4fa639d738 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -214,9 +214,9 @@ while ( my $c = $sth->fetchrow_hashref() ) { } my @subtitles = split(/ \| /, $c->{'subtitle'} // '' ); - my $item = Koha::Items->find( $c->{itemnumber} ); my $recalled = 0; if ( C4::Context->preference('UseRecalls') ) { + my $item = Koha::Items->find( $c->{itemnumber} ); my $recall = undef; $recall = $item->check_recalls if $item->can_be_waiting_recall; if ( defined $recall ) { -- 2.20.1