Bugzilla – Attachment 117143 Details for
Bug 27071
Hold pickup library match not enforced correctly on intranet when using hold groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27071: Use GetReservesControlBranch to pick the branch
Bug-27071-Use-GetReservesControlBranch-to-pick-the.patch (text/plain), 3.07 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-02-22 12:34:51 UTC
(
hide
)
Description:
Bug 27071: Use GetReservesControlBranch to pick the branch
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-02-22 12:34:51 UTC
Size:
3.07 KB
patch
obsolete
>From eff79f8af66b7cfe9358bb5cdaa1ccc84adc3b9b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 9 Feb 2021 12:14:19 -0300 >Subject: [PATCH] Bug 27071: Use GetReservesControlBranch to pick the branch > >Pretty much like the opac-reserve.pl does, this patch makes the staff >request.pl script get the branch from the specialized routine from >C4::Reserves instead of falling back to userenv. > >To test: >1. Follow the original test plan: >- Create two local hold groups containing distinct lists of libraries. >- In default rules for all libraries, set Hold Policy = "From local hold group" and Hold pickup library match to "Patron's hold group" >- Make sure AllowHoldPolicyOverride is set to Don't Allow > >- Make sure you're logged in at a library in Group 1 >- Find a bib with only 1 item from Group 1. Confirm you can place a hold on this title for a patron in Group 1 (correct), but not for a patron in Group 2 (correct). >- Find a bib with only 1 item from Group 2. Confirm you cannot place a hold for a patron from Group 1 (correct), BUT you also cannot place a hold for a patron from Group 2 (incorrect) -- Koha gives the erroneous message "pickupNotInHoldGroup" > >- Change your library to a something in Group 2 >- Find a bib with only 1 item from Group 1. Confirm you cannot place a hold on this title for a patron in Group 1 (incorrect), and not for a patron in Group 2 (correct). >- Find a bib with only 1 item from Group 2. Confirm you cannot place a hold for a patron from Group 1 (correct), but you can place a hold for a patron from Group 2 (correct) >=> FAIL: Things expected to fail on the plan, fail. >2. Apply this patches >3. Repeat 1 >=> SUCCESS: It now works! > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > reserve/request.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/reserve/request.pl b/reserve/request.pl >index 38d6f56ed25..13d0879f3fa 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -67,7 +67,7 @@ my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( > ); > > my $showallitems = $input->param('showallitems'); >-my $pickup = $input->param('pickup') || C4::Context->userenv->{'branch'}; >+my $pickup = $input->param('pickup'); > > my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; > >@@ -551,7 +551,8 @@ foreach my $biblionumber (@biblionumbers) { > > $item->{'holdallowed'} = $branchitemrule->{'holdallowed'}; > >- my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber, $pickup )->{status}; >+ my $reserves_control_branch = $pickup // C4::Reserves::GetReservesControlBranch( $item, $patron_unblessed ); >+ my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber, $reserves_control_branch )->{status}; > $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' ); > > $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } ); >-- >2.30.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 27071
:
113928
|
113929
|
113963
|
116599
|
116600
|
116601
|
116602
|
116603
|
117140
|
117141
|
117142
|
117143
|
117144
|
117145
|
117184
|
117185
|
117186
|
117187
|
117188
|
117189
|
117204
|
117205
|
117206
|
117207
|
117208
|
117209