Bug 29102: Remove ignore_found_holds

If not counting patrons holds, found or unfound, we no longer need this option
introduced by bug 28078

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2021-12-23 17:16:12 +00:00 committed by Tomas Cohen Arazi
parent 689958b37b
commit 0f9fcb1087
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 2 additions and 9 deletions

View file

@ -398,11 +398,8 @@ sub CanBookBeReserved{
if ($canReserve->{status} eq 'OK') { #We can reserve this Item! }
current params are:
'ignore_found_holds' - if true holds that have been trapped are not counted
toward the patron limit, used by checkHighHolds to avoid counting the hold we will fill with the
current checkout against the high holds threshold
'ignore_hold_counts' - we use this routine to check if an item can fill a hold - on this case we
should not check if there are too many holds as we only csre about reservability
should not check if there are too many holds as we only care about reservability
@RETURNS { status => OK }, if the Item can be reserved.
{ status => ageRestricted }, if the Item is age restricted for this borrower.
@ -515,7 +512,6 @@ sub CanItemBeReserved {
borrowernumber => $patron->borrowernumber,
biblionumber => $item->biblionumber,
};
$search_params->{found} = undef if $params->{ignore_found_holds};
my $holds = Koha::Holds->search($search_params);
return { status => "tooManyHoldsForThisRecord", limit => $holds_per_record } if $holds->count() >= $holds_per_record;
}

View file

@ -19,7 +19,7 @@
use Modern::Perl;
use Test::More tests => 16;
use Test::More tests => 15;
use t::lib::TestBuilder;
use t::lib::Mocks;
@ -251,7 +251,4 @@ Koha::Holds->find($hold_id)->found("W")->store;
$can = CanBookBeReserved($patron->{borrowernumber}, $biblio->biblionumber);
is( $can->{status}, 'tooManyHoldsForThisRecord', 'Third hold exceeds limit of holds per record' );
$can = CanBookBeReserved($patron->{borrowernumber}, $biblio->biblionumber, undef, { ignore_found_holds => 1 });
is( $can->{status}, 'OK', 'Third hold is allowed when ignoring waiting holds' );
$schema->storage->txn_rollback;