From b65dc007a9d80a930fc7a00cade42732dbab7e67 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 22 Sep 2023 16:16:09 +0100 Subject: [PATCH] Bug 34886: Restore 'Place reserve' prior to session This is a pragmatic patch to restore the display of 'Place hold' prior to patron login. When we have no Patron, we fall back to only checkout get_onshelfholds_policy without a patron. When we have a patron, we use IsAvailableForItemLevelRequest instead to get the more detailed response. This isn't perfect, but I can't see an easy way to restore this functionality otherwise. Signed-off-by: David Nind --- opac/opac-detail.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 5f5ce3013a..2483e55772 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -682,7 +682,12 @@ else { $item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding; $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home; - $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest($item, $patron, undef); + if ( $patron ) { + $can_item_be_reserved = IsAvailableForItemLevelRequest($item, $patron, undef); + } else { + $can_item_be_reserved = + Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => undef } ); + } # get collection code description, too my $ccode = $item->ccode; -- 2.30.2