@@ -, +, @@ --- Koha/CirculationRules.pm | 4 ++++ Koha/Template/Plugin/CirculationRules.pm | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) --- a/Koha/CirculationRules.pm +++ a/Koha/CirculationRules.pm @@ -50,6 +50,10 @@ sub get_effective_rule { croak q{No rule name passed in!} unless $rule_name; + for my $v ( $branchcode, $categorycode, $itemtype ) { + $v = undef if $v and $v eq '*'; + } + my $search_params; $search_params->{rule_name} = $rule_name; --- a/Koha/Template/Plugin/CirculationRules.pm +++ a/Koha/Template/Plugin/CirculationRules.pm @@ -30,14 +30,14 @@ sub Get { $categorycode = undef if $categorycode eq q{}; $itemtype = undef if $itemtype eq q{}; - my $rule = Koha::CirculationRules->search( + my $rule = Koha::CirculationRules->get_effective_rule( { branchcode => $branchcode, categorycode => $categorycode, itemtype => $itemtype, rule_name => $rule_name, } - )->next(); + ); return $rule->rule_value if $rule; } --