Bug 34694: Only check for IsAvailableForItemLevelRequest if is authenticated

- Go to circulation rules and set On shelf holds allowed to If all unavailable
- Log out
- Visit a bib record on OPAC:
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=76
- Notice it blows up with error 500
- Apply patch. Repeat

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-09-01 16:12:56 +00:00 committed by Tomas Cohen Arazi
parent cac122b611
commit 1742913a05
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -682,7 +682,7 @@ else {
$item_info->{holding_library_info} = $opac_info_holding->content if $opac_info_holding; $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; $item_info->{home_library_info} = $opac_info_home->content if $opac_info_home;
$can_item_be_reserved = $can_item_be_reserved || IsAvailableForItemLevelRequest($item, $patron, undef); $can_item_be_reserved = $can_item_be_reserved || $patron && IsAvailableForItemLevelRequest($item, $patron, undef);
# get collection code description, too # get collection code description, too
my $ccode = $item->ccode; my $ccode = $item->ccode;