Bugzilla – Attachment 125881 Details for
Bug 28748
When hold is overridden cannot select a pickup location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28748: Prepare pickup locations for overridden holds
Bug-28748-Prepare-pickup-locations-for-overridden-.patch (text/plain), 3.37 KB, created by
Marcel de Rooy
on 2021-10-07 13:34:54 UTC
(
hide
)
Description:
Bug 28748: Prepare pickup locations for overridden holds
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-10-07 13:34:54 UTC
Size:
3.37 KB
patch
obsolete
>From e904c5ffa0c6f174345a1c53e00ea1766d56333d Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 6 Oct 2021 11:57:19 +0000 >Subject: [PATCH] Bug 28748: Prepare pickup locations for overridden holds >Content-Type: text/plain; charset=utf-8 > >The logic in request.pl only passes pickup locations if a hold is allowed, >they are not calculated when the hold is overridden. > >This patch copies the pickup locations code into the override conditional, >adjusting to mark the item overridden > >This also highlights an condition of override: >If a hold is allowed, but there are no valid pickup locations the override >is not allowed. > >To test: > 1 - Set a holds rule to allow on-shelf holds only if all unavailable > 2 - Set AllowHoldPolicyOverride to 'Allow' > 3 - Find a record with several items available > 4 - Attempt to place a hold > 5 - The items have a yellow triangle, but no pickup locations > 6 - Place an item level hold > 7 - Note the hold has no pickup location > 8 - Cancel the hold > 9 - Apply patch and restart all >10 - Attempt hold again >11 - Items still have yellow triangle, but there are dropdowns for pickup location >12 - Place an item level hold, verify a pickup location is set >13 - Cancel the hold >14 - Alter circ rule to allow on shelf holds >15 - Change 'Default checkout, hold and return policy' - 'Hold pickup library match' to "item's hold group" >16 - Ensure there is no group for the item >17 - Attempt to place hold >18 - Override is not allowed 'No valid pickup locations' > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > reserve/request.pl | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >diff --git a/reserve/request.pl b/reserve/request.pl >index 95a7fd43d1..69212a3ced 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -615,8 +615,20 @@ foreach my $biblionumber (@biblionumbers) { > # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules > # with the exception of itemAlreadyOnHold because, you know, the item is already on hold > if ( $can_item_be_reserved ne 'itemAlreadyOnHold' ) { >- $item->{override} = 1; >- $num_override++; >+ # Send the pickup locations count to the UI, the pickup locations will be pulled using the API >+ my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); >+ $item->{pickup_locations_count} = $pickup_locations->count; >+ if ( $item->{pickup_locations_count} > 0 ) { >+ $item->{override} = 1; >+ $num_override++; >+ # pass the holding branch for use as default >+ my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next; >+ $item->{default_pickup_location} = $default_pickup_location; >+ } >+ else { >+ $item->{available} = 0; >+ $item->{not_holdable} = "no_valid_pickup_location"; >+ } > } else { $num_alreadyheld++ } > > push( @available_itemtypes, $item->{itype} ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28748
:
125782
|
125814
|
125880
| 125881