From 909038869db08304278443b46b35362c77093a10 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 4 Dec 2020 08:33:43 -0300 Subject: [PATCH] Bug 15448: (follow-up) Fetch the patron category once Signed-off-by: Kyle M Hall Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Jonathan Druart (cherry picked from commit c9f66f5e6b5360a57885c26436c7eb3f2747bd28) Signed-off-by: Fridolin Somers (cherry picked from commit cdfea7001131055c8d91459d4c48dbc4adb4741e) Signed-off-by: Andrew Fuerste-Henry (cherry picked from commit bbf2348bf070609ad876ccb4e82d4b98a9b3774b) Signed-off-by: Victor Grousset/tuxayo --- opac/opac-reserve.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index d5a40718e1..6ce75d0c7c 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -70,7 +70,7 @@ for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { m/priority/ and $show_priority = 1; } -my $patron = Koha::Patrons->find( $borrowernumber ); +my $patron = Koha::Patrons->find( $borrowernumber, { prefetch => ['categorycode'] } ); my $category = $patron->category; # no OpacHiddenItems rules used if category is excepted my $item_hide_rules = @@ -88,7 +88,7 @@ unless ( $can_place_hold_if_available_at_pickup ) { } # check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block -if ( $patron->category->effective_BlockExpiredPatronOpacActions ) { +if ( $category->effective_BlockExpiredPatronOpacActions ) { if ( $patron->is_expired ) { @@ -100,7 +100,7 @@ if ( $patron->category->effective_BlockExpiredPatronOpacActions ) { } # Pass through any reserve charge -my $reservefee = $patron->category->reservefee; +my $reservefee = $category->reservefee; if ( $reservefee > 0){ $template->param( RESERVE_CHARGE => $reservefee); } -- 2.39.5