From 3ddb375945db45cfef459930169192c7b18941bf Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Tue, 17 Nov 2020 14:24:36 +0100 Subject: [PATCH] Bug 20985: Add OnShelfHoldsAllowed checks to CanItemBeReserved The expected behaviour for "On shelf holds allowed" setting for the circulation rules (Koha administration > Patrons and circulation > Circulation and fines rules): - Allow holds only on items that are currently checked out or otherwise unavailable. - If set to "Yes", patrons can place holds on items currently checked in. - If set to "If any unavailable", patrons can only place holds on items that are not unavailable. - If set to "If all unavailable", patrons can only place holds on items where *all* items on the record are unavailable. (Adapted from https://bywatersolutions.com/education/preparing-for-library-closures) These rules should also work when using ILS-DI, but currently they don't. This bug makes sure that the "On shelf holds allowed" rules work correctly when using ILS-DI to place holds. Test plan --------- 1. Enable ILS-DI (set the ILS-DI system preference to Enable). 2. Go to Koha administration > Patrons and circulation > Circulation and fines rules. 3. Work through steps 4-5 for each of the settings for "On shelf holds allowed" for all libraries/patron categories/item types: "Yes", "If any unavailable", and "If all unavailable" 4. Staff interface - place a hold on a record with items available for loan, the rules should work as expected before and after the patch is applied: "Yes": information column in the item table displays "Not on hold", the hold is placed, cancel the hold "If any unavailable" and "If all unavailable": the hold is not placed, message is "Cannot place hold. No items are available to be placed on hold.", red "X" in the hold column and the information column displays "Not on hold" 5. ILS-DI - place a hold on a record with items available for loan (note: without the patch, holds can be placed): - Query to place a hold using ILS-DI on a title that have all its items available, example query: http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1&request_location=127.0.0.1 Without the patch the hold is placed but it shouldn't be allowed, cancel the hold - Query to place a hold using ILS-DI on an available item, example query: http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=HoldItem&patron_id=1&bib_id=1&item_id=1) Without the patch the hold is placed but it shouldn't be allowed, cancel the hold 6. Run the tests in t/db_dependent/Reserves.t - these should pass. 7. Apply the patch, flush the cache and restart Koha (if using koha-testing-docker, run flush_memcached and restart_all) 8. Run through steps 3-6 again, and note the changes when "If any unavailable" and "If all unavailable" options are used: For the staff interface: there should be no change in behavour and should work as expected, for the red "X" in the items table additional text is added "onShelfHoldsNotAllowed". For ILS-DI: these should now work as expected, with holds not placed, and this message in the results returned onShelfHoldsNotAllowed (check to confirm no holds place for either the patron or the item) Tests: should still pass, in particular the following tests: - t/db_dependent/Reserves.t - t/db_dependent/Holds.t - t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t - t/db_dependent/api/v1/holds.t - t/db_dependent/ILSDI_Services.t - t/db_dependent/Reserves/MultiplePerRecord.t - t/db_dependent/Reserves/IsOnShelfHoldsPolicySatisfied.t (new test file) --- C4/Reserves.pm | 89 ++++++++---- .../prog/en/modules/reserve/request.tt | 1 + t/db_dependent/Holds.t | 30 ++++ t/db_dependent/ILSDI_Services.t | 28 ++++ t/db_dependent/Reserves.t | 85 ++++++++++- .../Reserves/IsOnShelfHoldsPolicySatisfied.t | 135 ++++++++++++++++++ t/db_dependent/Reserves/MultiplePerRecord.t | 1 + t/db_dependent/api/v1/holds.t | 6 +- 8 files changed, 349 insertions(+), 26 deletions(-) create mode 100755 t/db_dependent/Reserves/IsOnShelfHoldsPolicySatisfied.t diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 6c23f935b46..4011b29a9ec 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -435,8 +435,12 @@ sub CanBookBeReserved { current params are: '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 care about reservability + 'ignore_onshelfholds_policy' - if set to a true value, do not check if the + "on shelf holds" policy is satisfied; useful to avoid infinite recursion with + IsOnShelfHoldsPolicySatisfied and ItemsAnyAvailableAndNotRestricted @RETURNS { status => OK }, if the Item can be reserved. + { status => onShelfHoldsNotAllowed }, if onShelfHoldsAllowed parameter and item availability combination doesn't allow holds. { status => ageRestricted }, if the Item is age restricted for this borrower. { status => damaged }, if the Item is damaged. { status => cannotReserveFromOtherBranches }, if syspref 'canreservefromotherbranches' is OK. @@ -701,6 +705,12 @@ sub CanItemBeReserved { } } + unless ( $params->{ignore_onshelfholds_policy} ) { + unless ( IsOnShelfHoldsPolicySatisfied( { item => $item, patron => $patron } ) ) { + return _cache { status => 'onShelfHoldsNotAllowed' }; + } + } + return _cache { status => 'OK' }; } @@ -1409,29 +1419,7 @@ sub IsAvailableForItemLevelRequest { || $home_library->validate_hold_sibling( { branchcode => $pickup_branchcode } ); } - my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); - - if ( $on_shelf_holds == 1 ) { - return 1; - } elsif ( $on_shelf_holds == 2 ) { - - # These calculations work at the biblio level, and can be expensive - # we use the in-memory cache to avoid calling once per item when looping items on a biblio - - my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); - my $cache_key = sprintf "ItemsAnyAvailableAndNotRestricted:%s:%s", $patron->id, $item->biblionumber; - - my $any_available = $memory_cache->get_from_cache($cache_key); - return $any_available ? 0 : 1 if defined($any_available); - - $any_available = - ItemsAnyAvailableAndNotRestricted( { biblionumber => $item->biblionumber, patron => $patron } ); - $memory_cache->set_in_cache( $cache_key, $any_available ); - return $any_available ? 0 : 1; - - } else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) - return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count; - } + return IsOnShelfHoldsPolicySatisfied( { item => $item, patron => $patron } ); } =head2 ItemsAnyAvailableAndNotRestricted @@ -1468,12 +1456,65 @@ sub ItemsAnyAvailableAndNotRestricted { || $branchitemrule->{holdallowed} eq 'from_home_library' && $param->{patron}->branchcode ne $i->homebranch || $branchitemrule->{holdallowed} eq 'from_local_hold_group' && !$item_library->validate_hold_sibling( { branchcode => $param->{patron}->branchcode } ) - || CanItemBeReserved( $param->{patron}, $i )->{status} ne 'OK'; + || CanItemBeReserved( $param->{patron}, $i, undef, { ignore_onshelfholds_policy => 1 } )->{status} ne 'OK'; } return 0; } +=head2 IsOnShelfHoldsPolicySatisfied + +Verifies if a patron can place a hold on an item according to the "on shelf +holds" policy. + +Uses in-memory cache. + + $policy_ok = IsOnShelfHoldsPolicySatisfied({ item => $item, patron => $patron }) + +=head3 Parameters + +=over + +=item C<$item> - a Koha::Item object + +=item C<$patron> - a Koha::Patron object + +=back + +=head3 Return value + +a true value if the hold is possible, a false value otherwise + +=cut + +sub IsOnShelfHoldsPolicySatisfied { + my ($args) = @_; + my ( $item, $patron ) = @$args{qw(item patron)}; + + my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy( { item => $item, patron => $patron } ); + + if ( $on_shelf_holds == 1 ) { + return 1; + } elsif ( $on_shelf_holds == 2 ) { + + # These calculations work at the biblio level, and can be expensive + # we use the in-memory cache to avoid calling once per item when looping items on a biblio + + my $memory_cache = Koha::Cache::Memory::Lite->get_instance(); + my $cache_key = sprintf "IsOnShelfHoldsPolicySatisfied:%s:%s", $patron->id, $item->biblionumber; + + my $any_available = $memory_cache->get_from_cache($cache_key); + return $any_available ? 0 : 1 if defined($any_available); + + $any_available = + ItemsAnyAvailableAndNotRestricted( { biblionumber => $item->biblionumber, patron => $patron } ); + $memory_cache->set_in_cache( $cache_key, $any_available ); + return $any_available ? 0 : 1; + } else { # on_shelf_holds == 0 "If any unavailable" (the description is rather cryptic and could still be improved) + return $item->notforloan < 0 || $item->onloan || $item->holds->filter_by_found->count; + } +} + =head2 AlterPriority AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 02dd27aa3b9..772b25ad65a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1430,6 +1430,7 @@ tooManyReserves: _("Too many holds"), notReservable: _("Not holdable"), noReservesAllowed: _("No reserves allowed"), + onShelfHoldsNotAllowed: _("Not holdable"), cannotReserveFromOtherBranches: _("Patron is from different library"), itemAlreadyOnHold: _("Patron already has hold for this item"), cannotBeTransferred: _("Cannot be transferred to pickup library"), diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index 52a5158d2e1..9072eb7a193 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -253,6 +253,7 @@ Koha::CirculationRules->set_rules( branchcode => undef, itemtype => undef, rules => { + onshelfholds => 1, reservesallowed => 25, holds_per_record => 99, } @@ -264,6 +265,7 @@ Koha::CirculationRules->set_rules( branchcode => undef, itemtype => 'CANNOT', rules => { + onshelfholds => 1, reservesallowed => 0, holds_per_record => 99, } @@ -468,6 +470,7 @@ subtest 'CanItemBeReserved' => sub { branchcode => undef, itemtype => $itemtype_cant, rules => { + onshelfholds => 1, reservesallowed => 0, holds_per_record => 99, } @@ -479,6 +482,7 @@ subtest 'CanItemBeReserved' => sub { branchcode => undef, itemtype => $itemtype_can, rules => { + onshelfholds => 1, reservesallowed => 2, holds_per_record => 2, } @@ -490,6 +494,7 @@ subtest 'CanItemBeReserved' => sub { branchcode => undef, itemtype => $itemtype_cant_record, rules => { + onshelfholds => 1, reservesallowed => 0, holds_per_record => 0, } @@ -650,6 +655,7 @@ subtest 'CanItemBeReserved' => sub { branchcode => undef, itemtype => undef, rules => { + onshelfholds => 1, reservesallowed => 5, holds_per_record => 1, } @@ -729,6 +735,7 @@ Koha::CirculationRules->set_rules( branchcode => undef, itemtype => undef, rules => { + onshelfholds => 1, reservesallowed => 25, holds_per_record => 99, } @@ -802,6 +809,7 @@ Koha::CirculationRules->set_rules( branchcode => undef, itemtype => 'ONLY1', rules => { + onshelfholds => 1, reservesallowed => 1, holds_per_record => 99, } @@ -853,6 +861,7 @@ subtest 'Test max_holds per library/patron category' => sub { branchcode => undef, itemtype => $biblio->itemtype, rules => { + onshelfholds => 1, reservesallowed => 99, holds_per_record => 99, } @@ -933,6 +942,7 @@ subtest 'Pickup location availability tests' => sub { categorycode => undef, itemtype => undef, rules => { + onshelfholds => 1, reservesallowed => 25, holds_per_record => 99, } @@ -1006,6 +1016,7 @@ subtest 'CanItemBeReserved / holds_per_day tests' => sub { itemtype => $itemtype->itemtype, rules => { reservesallowed => 1, + onshelfholds => 1, holds_per_record => 99, holds_per_day => 2 } @@ -1175,6 +1186,15 @@ subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { rule_value => 25, } ); + Koha::CirculationRules->set_rule( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rule_name => 'onshelfholds', + rule_value => 1, + } + ); # Create item types my $itemtype1 = $builder->build_object( { class => 'Koha::ItemTypes' } ); @@ -1402,6 +1422,15 @@ subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { rule_value => 25, } ); + Koha::CirculationRules->set_rule( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rule_name => 'onshelfholds', + rule_value => 1, + } + ); # Create item types my $itemtype1 = $builder->build_object( { class => 'Koha::ItemTypes' } ); @@ -1774,6 +1803,7 @@ subtest 'CanItemBeReserved rule precedence tests' => sub { categorycode => $patron->categorycode, itemtype => $item->itype, rules => { + onshelfholds => 1, reservesallowed => 1, } } diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index 0a75e7dd748..bef3a76e992 100755 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -512,6 +512,16 @@ subtest 'Holds test' => sub { } ); + Koha::CirculationRules->set_rule( + { + categorycode => undef, + itemtype => undef, + branchcode => undef, + rule_name => 'onshelfholds', + rule_value => 1, + } + ); + t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'PatronLibrary' ); Koha::CirculationRules->set_rule( { @@ -698,6 +708,15 @@ subtest 'Holds test for branch transfer limits' => sub { rule_value => 99, } ); + Koha::CirculationRules->set_rule( + { + categorycode => undef, + itemtype => undef, + branchcode => undef, + rule_name => 'onshelfholds', + rule_value => 1, + } + ); my $limit = Koha::Item::Transfer::Limit->new( { @@ -770,6 +789,15 @@ subtest 'Holds test with start_date and end_date' => sub { rule_value => 99, } ); + Koha::CirculationRules->set_rule( + { + categorycode => undef, + itemtype => undef, + branchcode => undef, + rule_name => 'onshelfholds', + rule_value => 1, + } + ); my $query = CGI->new; $query->param( 'pickup_location', $pickup_library->branchcode ); diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 79d6796f82e..ca29cb16d99 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 70; +use Test::More tests => 71; use Test::NoWarnings; use Test::MockModule; use Test::Warn; @@ -181,6 +181,7 @@ Koha::CirculationRules->set_rules( rules => { reservesallowed => 25, holds_per_record => 1, + onshelfholds => 1, } } ); @@ -1024,6 +1025,75 @@ subtest 'ChargeReserveFee tests' => sub { is( $line->branchcode, $library->id, "Library id is picked from userenv and stored correctly" ); }; +subtest 'OnShelfHoldAllowed test' => sub { + plan tests => 3; + $dbh->do('DELETE FROM circulation_rules'); + my $biblio = $builder->build_sample_biblio( { frameworkcode => $frameworkcode } )->biblionumber; + + # Create a helper item instance for testing + my $item = $builder->build_sample_item( { biblionumber => $biblio, library => $branch_1, itype => $itemtype } ); + + Koha::CirculationRules->set_rules( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rules => { + reservesallowed => 25, + opacitemholds => 'Y', + onshelfholds => 1, + } + } + ); + + my $canreserve = C4::Reserves::CanItemBeReserved( $patron, $item ); + + is( + $canreserve->{status}, 'OK', + 'item-level holds should be possible with onshelfholdallowed set to "Yes"' + ); + + Koha::CirculationRules->set_rules( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rules => { + reservesallowed => 25, + opacitemholds => 'Y', + onshelfholds => '0', + } + } + ); + + $canreserve = C4::Reserves::CanItemBeReserved( $patron, $item ); + + is( + $canreserve->{status}, 'onShelfHoldsNotAllowed', + 'item-level holds should not be possible with onshelfholdallowed set to "If any unavailable"' + ); + + Koha::CirculationRules->set_rules( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rules => { + reservesallowed => 25, + opacitemholds => 'Y', + onshelfholds => '2', + } + } + ); + + $canreserve = C4::Reserves::CanItemBeReserved( $patron, $item ); + + is( + $canreserve->{status}, 'onShelfHoldsNotAllowed', + 'item-level holds should not be possible with onshelfholdallowed set to "If all unavailable"' + ); +}; + subtest 'MoveReserve additional test' => sub { plan tests => 8; @@ -1307,6 +1377,17 @@ subtest 'AllowHoldOnPatronPossession test' => sub { } ); + Koha::CirculationRules->set_rules( + { + branchcode => undef, + categorycode => undef, + itemtype => undef, + rules => { + onshelfholds => 1, + } + } + ); + C4::Circulation::AddIssue( $patron, $item->barcode @@ -1650,6 +1731,7 @@ subtest 'CanBookBeReserved() tests' => sub { itemtype => $itype->id, rules => { reservesallowed => 2, + onshelfholds => 1, } } ); @@ -1729,6 +1811,7 @@ subtest 'CanItemBeReserved() tests' => sub { itemtype => $itype->id, rules => { reservesallowed => 2, + onshelfholds => 1, } } ); diff --git a/t/db_dependent/Reserves/IsOnShelfHoldsPolicySatisfied.t b/t/db_dependent/Reserves/IsOnShelfHoldsPolicySatisfied.t new file mode 100755 index 00000000000..bbf4e0170ca --- /dev/null +++ b/t/db_dependent/Reserves/IsOnShelfHoldsPolicySatisfied.t @@ -0,0 +1,135 @@ +#!/usr/bin/perl + +use Modern::Perl; + +use Test::More; + +use t::lib::TestBuilder; +use Koha::Database; +use Koha::Cache::Memory::Lite; +use Koha::DateUtils qw( dt_from_string ); +use C4::Reserves; + +plan tests => 1; + +my $schema = Koha::Database->schema; +my $circulationrule_rs = $schema->resultset('CirculationRule'); +my $builder = t::lib::TestBuilder->new; + +subtest '2 items, 1 itemtype, 1 library' => sub { + plan tests => 3; + $schema->txn_begin; + + my $itemtype = $builder->build_object( { class => 'Koha::ItemTypes' } )->itemtype; + my $library = $builder->build_object( { class => 'Koha::Libraries' } ); + my $branchcode = $library->branchcode; + my $biblio = $builder->build_sample_biblio( { itemtype => $itemtype } ); + my $item1 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, library => $branchcode } ); + my $item2 = $builder->build_sample_item( { biblionumber => $biblio->biblionumber, library => $branchcode } ); + my $patron = + $builder->build_object( { class => 'Koha::Patrons', value => { branchcode => $branchcode } } ); + my $categorycode = $patron->categorycode; + + $circulationrule_rs->populate( + [ + [ 'branchcode', 'categorycode', 'itemtype', 'rule_name', 'rule_value' ], + [ $branchcode, undef, $itemtype, 'holdallowed', 'from_any_library' ], + [ $branchcode, undef, $itemtype, 'hold_fulfillment_policy', 'any' ], + [ $branchcode, $categorycode, undef, 'max_holds', '99' ], + [ $branchcode, $categorycode, $itemtype, 'holds_per_day', '99' ], + [ $branchcode, $categorycode, $itemtype, 'holds_per_record', '99' ], + [ $branchcode, $categorycode, $itemtype, 'reservesallowed', '99' ], + ] + ); + my $onshelfholds_rule = $circulationrule_rs->create( + { + branchcode => $branchcode, + categorycode => $categorycode, + itemtype => $itemtype, + rule_name => 'onshelfholds', + rule_value => '0', + } + ); + + subtest 'when all items are available' => sub { + plan tests => 3; + + $onshelfholds_rule->update( { rule_value => '0' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + !C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is not allowed if onshelfholds == 0' + ); + + $onshelfholds_rule->update( { rule_value => '1' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is always allowed if onshelfholds == 1' + ); + + $onshelfholds_rule->update( { rule_value => '2' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + !C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is not allowed if onshelfholds == 2' + ); + }; + + subtest 'when checked item is not available but others are available' => sub { + plan tests => 3; + + $item1->onloan( dt_from_string() )->store; + + $onshelfholds_rule->update( { rule_value => '0' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is allowed if onshelfholds == 0' + ); + + $onshelfholds_rule->update( { rule_value => '1' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is always allowed if onshelfholds == 1' + ); + + $onshelfholds_rule->update( { rule_value => '2' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + !C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is not allowed if onshelfholds == 2' + ); + }; + + subtest 'when all items are unavailable' => sub { + plan tests => 3; + + $item1->onloan( dt_from_string() )->store; + $item2->onloan( dt_from_string() )->store; + + $onshelfholds_rule->update( { rule_value => '0' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is allowed if onshelfholds == 0' + ); + + $onshelfholds_rule->update( { rule_value => '1' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is always allowed if onshelfholds == 1' + ); + + $onshelfholds_rule->update( { rule_value => '2' } ); + Koha::Cache::Memory::Lite->flush(); + ok( + C4::Reserves::IsOnShelfHoldsPolicySatisfied( { item => $item1, patron => $patron } ), + 'on shelf hold is allowed if onshelfholds == 2' + ); + }; + + $schema->txn_rollback; +}; diff --git a/t/db_dependent/Reserves/MultiplePerRecord.t b/t/db_dependent/Reserves/MultiplePerRecord.t index b3b3fb35772..e845b5a2f07 100755 --- a/t/db_dependent/Reserves/MultiplePerRecord.t +++ b/t/db_dependent/Reserves/MultiplePerRecord.t @@ -220,6 +220,7 @@ Koha::CirculationRules->set_rules( itemtype => undef, branchcode => undef, rules => { + onshelfholds => 1, reservesallowed => 3, holds_per_record => 2, } diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t index e98d8b125e0..bc6fd95fe51 100755 --- a/t/db_dependent/api/v1/holds.t +++ b/t/db_dependent/api/v1/holds.t @@ -128,6 +128,7 @@ Koha::CirculationRules->set_rules( branchcode => undef, itemtype => undef, rules => { + onshelfholds => 1, reservesallowed => 1, holds_per_record => 99 } @@ -729,7 +730,10 @@ subtest 'add() tests (maxreserves behaviour)' => sub { itemtype => undef, branchcode => undef, categorycode => undef, - rules => { reservesallowed => 3 } + rules => { + onshelfholds => 1, + reservesallowed => 3 + } } ); -- 2.39.5