Bug 38134 - Koha::Items::filter_by_for_hold does not work
Summary: Koha::Items::filter_by_for_hold does not work
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: 23.11
Hardware: All All
: P1 - high major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-10 07:59 UTC by Andreas Jonsson
Modified: 2024-10-10 07:59 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.