From feb444c5851d8c834b0a50a6ead110eb6a5426e6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 3 Dec 2020 06:34:33 -0500 Subject: [PATCH] Bug 27068: Fix errors in _checkHoldPolicy Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 9f71452b934ef83c57ac2f74c0c7b0ea2b39e2cd) Signed-off-by: Fridolin Somers --- C4/HoldsQueue.pm | 6 +++--- Koha/Library.pm | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index e2666aa4ab..d4380ccfa8 100644 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -383,12 +383,12 @@ sub _checkHoldPolicy { my $hold_fulfillment_policy = $item->{hold_fulfillment_policy}; return 0 if $hold_fulfillment_policy eq 'holdgroup' && !$library->validate_hold_sibling({branchcode => $request->{branchcode}}); - return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->$hold_fulfillment_policy; - return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->$hold_fulfillment_policy; + return 0 if $hold_fulfillment_policy eq 'homebranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; + return 0 if $hold_fulfillment_policy eq 'holdingbranch' && $request->{branchcode} ne $item->{$hold_fulfillment_policy}; my $patronLibrary = Koha::Libraries->find($request->{borrowerbranch}); - return 0 if $hold_fulfillment_policy eq 'patrongroup' && !patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}}); + return 0 if $hold_fulfillment_policy eq 'patrongroup' && !$patronLibrary->validate_hold_sibling({branchcode => $request->{branchcode}}); return 1; diff --git a/Koha/Library.pm b/Koha/Library.pm index b69fdaaeab..fc2f4f522e 100644 --- a/Koha/Library.pm +++ b/Koha/Library.pm @@ -240,6 +240,9 @@ Return if given library is a valid hold group member sub validate_hold_sibling { my ( $self, $params ) = @_; + + return 1 if $params->{branchcode} eq $self->id; + my @hold_libraries = $self->get_hold_libraries; foreach (@hold_libraries) { -- 2.39.5