Bug 38134

Summary: Koha::Items::filter_by_for_hold does not work
Product: Koha Reporter: Andreas Jonsson <andreas.jonsson>
Component: CirculationAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: major    
Priority: P1 - high CC: gmcharlt, kyle.m.hall
Version: 23.11   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Andreas Jonsson 2024-10-10 07:59:25 UTC
We noticed that the place hold button is often incorrecty missing in the detail view in the staff interface after upgrading to 23.11.09.  This is due to the number of holdable items is incorrectly determined to be 0.

But the method filter_by_for_hold incorrectly assumes that Koha::CirculationRules->get_effective_rule can be used to filter on rule value:

my $default_rule = Koha::CirculationRules->get_effective_rule(
 	        {
 	            rule_name    => 'holdallowed',
 	            rule_value   => 'not_allowed',
 	        }
 	    );

But it cannot:

 print Dumper($default_rule->unblessed);

$VAR1 = {
          'categorycode' => undef,
          'id' => 268,
          'itemtype' => undef,
          'branchcode' => undef,
          'rule_name' => 'holdallowed',
          'rule_value' => 'from_any_library'
        };

Bug 29087 introduced this change.
Comment 1 Andreas Jonsson 2024-12-10 06:28:47 UTC
Fixed by Bug 38148

*** This bug has been marked as a duplicate of bug 38148 ***