From e2be4e00a5bf0920786339f5f47997508be93c4d Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 11 Oct 2024 01:53:11 +0000 Subject: [PATCH] Bug 38148: Check value of holdallowed circ rule properly It was noted on Bug 29087 that the value of circulation rules needs to be checked differently, so this follow-up addresses that. To test: 1. Apply patch and restart services 2. Search for a record on the OPAC. Confirm you can see a link to place a hold. 3. Search for this record on the staff interface and place a hold. Go to Circulation -> Holds to pull and confirm your hold shows in the list. 4. Confirm tests still pass t/db_dependent/Koha/Holds.t Sponsored-by: Whanganui District Council Signed-off-by: David Nind Signed-off-by: andrewa Signed-off-by: Ray Delahunty Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer --- Koha/Items.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Koha/Items.pm b/Koha/Items.pm index 1676a87597..8ef9f6f038 100644 --- a/Koha/Items.pm +++ b/Koha/Items.pm @@ -61,14 +61,16 @@ placing a hold on one of those items. sub filter_by_for_hold { my ($self) = @_; - my $default_rule = Koha::CirculationRules->get_effective_rule( + my $default_rule = Koha::CirculationRules->get_effective_rule_value( { rule_name => 'holdallowed', - rule_value => 'not_allowed', + itemtype => undef, + branchcode => undef, + categorycode => undef, } ); my @hold_not_allowed_itypes; - if ($default_rule) { + if ($default_rule eq 'not_allowed') { @hold_not_allowed_itypes = Koha::ItemTypes->search->get_column('itemtype'); my @hold_allowed_itypes = Koha::CirculationRules->search( { -- 2.39.5