From 6eeda6e8f08162e4737df70c094625029eb3a3a3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 7 Dec 2018 15:18:20 -0300 Subject: [PATCH] Bug 18936: Fix several issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Minna Kivinen Signed-off-by: Joonas Kylmälä --- Koha/CirculationRules.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/CirculationRules.pm b/Koha/CirculationRules.pm index d462a2137d..fdcd9d5506 100644 --- a/Koha/CirculationRules.pm +++ b/Koha/CirculationRules.pm @@ -240,14 +240,15 @@ 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( rule_name rule_value ) ) { Koha::Exceptions::MissingParameter->throw( - "Required parameter 'branchcode' missing") + "Required parameter '$mandatory_parameter' missing") unless exists $params->{$mandatory_parameter}; } my $kind_info = $RULE_KINDS->{ $params->{rule_name} }; - croak "set_rule given unknown rule '$params->{rule_name}'!" + Koha::Exceptions::MissingParameter->throw( + "set_rule given unknown rule '$params->{rule_name}'!") unless defined $kind_info; # Enforce scope; a rule should be set for its defined scope, no more, no less. -- 2.11.0