From 2357af920361b3fa205781775e4a37554ccd7a12 Mon Sep 17 00:00:00 2001 From: Slava Shishkin Date: Thu, 18 Jun 2020 12:11:29 +0300 Subject: [PATCH] Bug 25695: merge of similar code blocks after circulation_rules update In onboarding.pl we have second block with adding just one more rule parameter (maxissueqty) which can be merged to first one after all parameters now stored in circulation_rules table. Also this eliminates the need of adding forgotten "warn $@" after the second eval block. Mentored-by: Andrew Nugged --- installer/onboarding.pl | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 547e74fe9e..d08f4e9856 100755 --- a/installer/onboarding.pl +++ b/installer/onboarding.pl @@ -272,7 +272,7 @@ if ( $step == 5 ) { hardduedatecompare => -1, holds_per_day => $holds_per_day, holds_per_record => $holds_per_record, - maxissueqty => "", + maxissueqty => $maxissueqty, maxonsiteissueqty => "", maxsuspensiondays => "", no_auto_renewal_after => "", @@ -293,28 +293,6 @@ if ( $step == 5 ) { if ($@) { warn $@; push @messages, { code => 'error_on_insert_circ_rule' }; - } else { - - eval { - Koha::CirculationRules->set_rules( - { - categorycode => $categorycode, - itemtype => $itemtype, - branchcode => $branchcode, - rules => { - maxissueqty => $maxissueqty, - } - } - ); - }; - - unless ($@) { - push @messages, { code => 'success_on_insert_circ_rule' }; - } - else { - warn $@; - push @messages, { code => 'error_on_insert_circ_rule' }; - } } } -- 2.17.1