Bug 27068: Fix errors in _checkHoldPolicy
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
e82091f40a
commit
9f71452b93
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue