From 28558bcee7a417595d0c56fbe5fc106e077615c9 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 Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 5c581265abff940350df83a52228085aa0792fe0) Signed-off-by: Lucas Gass --- installer/onboarding.pl | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 5d10d23c11..7a76342311 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 => "", @@ -294,26 +294,7 @@ if ( $step == 5 ) { 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 { - push @messages, { code => 'error_on_insert_circ_rule' }; - } + push @messages, { code => 'success_on_insert_circ_rule' }; } } -- 2.39.5