From 1b8702c8577627a346cec0d4fbec0b0f2cc45a27 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 6 Dec 2018 16:54:39 -0300 Subject: [PATCH] Bug 18936: Fix syntax issue TODO: Replace croak with exceptions --- Koha/CirculationRules.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm index a6ed947ebe..d462a2137d 100644 --- a/Koha/CirculationRules.pm +++ b/Koha/CirculationRules.pm @@ -18,6 +18,7 @@ package Koha::CirculationRules; # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use Modern::Perl; +use Carp qw(croak); use Koha::Exceptions; use Koha::CirculationRule; @@ -239,10 +240,11 @@ sub get_effective_rules { sub set_rule { my ( $self, $params ) = @_; - for my $mandatory_parameter (qw( branchcode categorycode itemtype rule_name rule_value ) ){ + for my $mandatory_parameter (qw( branchcode categorycode itemtype rule_name rule_value ) ) { Koha::Exceptions::MissingParameter->throw( "Required parameter 'branchcode' missing") unless exists $params->{$mandatory_parameter}; + } my $kind_info = $RULE_KINDS->{ $params->{rule_name} }; croak "set_rule given unknown rule '$params->{rule_name}'!" -- 2.11.0