From 9beaf2c50eac0fbf7c6befa4ada2cbe8c02fb049 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 5 May 2022 04:28:17 +0000 Subject: [PATCH] Bug 30687: Override hold policy when no valid pickup location This patch allows hold policy to be overridden when there is no valid pickup location and AllowHoldPolicyOverride is enabled. This is re-implementing old behaviour that has been lost. To test: 1. Go to Administration -> Circulation and fines rules. Ensure there is a default circulation rule and default reserves policy. 2. Change the library using the dropdown and scroll to the bottom of the page to set a reserves policy by item type for Library A, which the following settings: - Item type: BK - Reserve policy: From home library - Reserve pickup library match: any library - Return policy: Item returns home 3. Go to Administration -> system preferences. Set the AllowHoldPolicyOverride setting to Allow. 4. Create a biblio with an item where the item's home library is Library A and the itemtype is BK. 5. Log in to the staff client as a Patron that belongs to Library B. 6. Search for the biblio you just created and try to request a hold for yourself. Notice there is a blocking notice "Cannot place reserve", the "Place reserve" button is disabled, and the item has a "No valid pickup location" error. 7. Apply the patch and refresh the page or re-request the hold. 8. Confirm you can now place the hold, acknowledging that you must override hold policy to do so (note the exclamation point icon). 9. Set the AllowHoldPolicyOverride system preference to "Don't allow". 10. Repeat Step 6. Confirm you are blocked again from requesting the hold and cannot override it. Sponsored-by: Chartered Accountants Australia and New Zealand Signed-off-by: Daniel Signed-off-by: Kyle M Hall --- reserve/request.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reserve/request.pl b/reserve/request.pl index 5fcb7ad0b2..6c65fd3e5d 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -546,6 +546,8 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) else { $item->{available} = 0; $item->{not_holdable} = "no_valid_pickup_location"; + $item->{override} = 1; + $num_override++; } } else { $num_alreadyheld++ } -- 2.30.2