From: Slava Shishkin Date: Thu, 18 Jun 2020 09:11:29 +0000 (+0300) Subject: Bug 25695: merge of similar code blocks after circulation_rules update X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=5c581265abff940350df83a52228085aa0792fe0 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 --- diff --git a/installer/onboarding.pl b/installer/onboarding.pl index 5d10d23..7a76342 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' }; } }