placerequest.pl checks CanItemBeReserved and correctly fails a hold, however, an item that is not holdable because it cannot be transferred is selectable while placing holds and will fail silently as placerequest.pl doesn't set any params for feedback if a hold fails, it expects the hold screen to block any unwanted holds To recreate: 1 - Set preferences: UseBranchTransferLimits: enforce BranchTransferLimitsType: itype AllowHoldPolicyOverride: Don't allow 2 - Set Centerville 'Book' items to not be allowed to transfer to any other library 3 - Make sure Hold policy is set to 'any library' 4 - Find a record with a Centerville item and other items 5 - Attempt to place an item level hold on the Centerville item 6 - You are taken to the holds list, but your hold is not placed 7 - Nothing indicates why hold has failed
Ensure that the pickup library is different than CPL
Caused by commit 2c5e9bed7de83d01be755475b96a3cf439e0126c Bug 23116: AllowHoldPolicyOverride allows a librarian to almost place a hold on an item already on hold
Caused by: commit 546a3b6d4d6333fe938572f0247dfcbe4a4d35a8 Bug 22284: New message, new column and filter pickup locations in reserve/request.tt
- my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber, $pickup )->{status}; - $item->{not_holdable} = $can_item_be_reserved unless $can_item_be_reserved eq 'OK'; + my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber )->{status}; The $pickup parameter disappears.
Created attachment 113497 [details] [review] Bug 26990: (bug 22284 follow-up) Prevent hold to be placed if cannot be transferred There is a missing parameter to CanItemBeReserved, we need to know if the hold can be placed at a given pickup library. Test plan: 1 - Set preferences: UseBranchTransferLimits: enforce BranchTransferLimitsType: itype AllowHoldPolicyOverride: Don't allow 2 - Set Centerville 'Book' items to not be allowed to transfer to any other library 3 - Make sure Hold policy is set to 'any library' 4 - Find a record with a Centerville item and other items 5 - Attempt to place an item level hold on the Centerville item (with a pickup library different than Centerville) => Without this patch you are taken to the holds list, but your hold is not placed Nothing indicates why hold has failed => With this patch you cannot select the item from Centerville "Cannot be transferred to pickup library"
Created attachment 113532 [details] [review] Bug 26990: (bug 22284 follow-up) Prevent hold to be placed if cannot be transferred There is a missing parameter to CanItemBeReserved, we need to know if the hold can be placed at a given pickup library. Test plan: 1 - Set preferences: UseBranchTransferLimits: enforce BranchTransferLimitsType: itype AllowHoldPolicyOverride: Don't allow 2 - Set Centerville 'Book' items to not be allowed to transfer to any other library 3 - Make sure Hold policy is set to 'any library' 4 - Find a record with a Centerville item and other items 5 - Attempt to place an item level hold on the Centerville item (with a pickup library different than Centerville) => Without this patch you are taken to the holds list, but your hold is not placed Nothing indicates why hold has failed => With this patch you cannot select the item from Centerville "Cannot be transferred to pickup library" Signed-off-by: David Nind <david@davidnind.com>
My notes from testing Step 2: 1. Go to Administration > Patrons and circulation > Library transfer limits. 2. Make sure Centerville is selected as the library. 3. For BK click on clear all then save. 4. Note that CPL still stays selected. Step 4, before step 4 change the library in the staff interface to a library other than Centerville.
Created attachment 113554 [details] [review] Bug 26990: (bug 22284 follow-up) Prevent hold to be placed if cannot be transferred There is a missing parameter to CanItemBeReserved, we need to know if the hold can be placed at a given pickup library. Test plan: 1 - Set preferences: UseBranchTransferLimits: enforce BranchTransferLimitsType: itype AllowHoldPolicyOverride: Don't allow 2 - Set Centerville 'Book' items to not be allowed to transfer to any other library 3 - Make sure Hold policy is set to 'any library' 4 - Find a record with a Centerville item and other items 5 - Attempt to place an item level hold on the Centerville item (with a pickup library different than Centerville) => Without this patch you are taken to the holds list, but your hold is not placed Nothing indicates why hold has failed => With this patch you cannot select the item from Centerville "Cannot be transferred to pickup library" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.06
missing dependencies, not backported to 19.11.x