https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43448
Bug ID: 43448
Summary: Unreachable code in reserve/request.pl
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Hold requests
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected],
[email protected]
Target Milestone: ---
This stems from a fix on bug 35573 - when AllowHoldPolicyOverride is enabled,
we never want to fully prevent a hold because there are no pickup locations
available. The code current checks AllowHoldPolicyOverride then gates on a
coutn of pickup locations or the value of AllowHoldPolicyOverride
Since we have already entered a conditional on AllowHoldPolicyOverride it will
always be true at the second check, so the 'else' is meaningless
I thought at first that the second condition should be removed, but it is there
to prevent us from ever hitting the 'else' so we should remove the else and the
condition
600 } elsif (
C4::Context->preference('AllowHoldPolicyOverride') ) {
601
602 # If AllowHoldPolicyOverride is set, it should
override EVERY restriction, not just branch item rules
603 # with the exception of itemAlreadyOnHold because,
you know, the item is already on hold
604 if ( $can_item_be_reserved ne 'itemAlreadyOnHold' )
{
605
606 # Send the pickup locations count to the UI,
the pickup locations will be pulled using the API
607 my @pickup_locations =
$item_object->pickup_locations( { patron => $patron } )->as_list;
608 $item->{pickup_locations_count} = scalar
@pickup_locations;
609
610 if ( @pickup_locations ||
C4::Context->preference('AllowHoldPolicyOverride') ) {
611 $num_items_available++;
612 $item->{override} = 1;
613 $num_override++;
614
615 my $default_pickup_location;
616
617 ($default_pickup_location) =
618 grep { $_->branchcode eq
$default_pickup_branch } @pickup_locations;
619
620 $item->{default_pickup_location} =
$default_pickup_location;
621 } else {
622 $item->{available} = 0;
623 $item->{not_holdable} =
"no_valid_pickup_location";
624 }
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/