From 4ec3fe042dd272a7ef251417f1d9a45bd1a9ead8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 Jan 2020 14:14:41 +0100 Subject: [PATCH] Bug 18936: Fix warning about page about wrong lengthunit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Minna Kivinen Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize --- about.pl | 7 ++----- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/about.pl b/about.pl index 18293b5db4..42fe42f170 100755 --- a/about.pl +++ b/about.pl @@ -456,12 +456,9 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; # Circ rule warnings { my $dbh = C4::Context->dbh; - my $units = $dbh->selectall_arrayref( - q|SELECT branchcode, categorycode, itemtype, lengthunit FROM issuingrules WHERE lengthunit NOT IN ( 'days', 'hours' ); |, - { Slice => {} } - ); + my $units = Koha::CirculationRules->search({ rule_name => 'lengthunit', rule_value => { -not_in => ['days', 'hours'] } }); - if (@$units) { + if ( $units->count ) { $template->param( warnIssuingRules => 1, ir_units => $units, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 1c94254b6c..1540b5630d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -412,9 +412,9 @@ [% FOREACH unit IN ir_units %] Warning - The [% unit.branchcode | html %], [% unit.categorycode | html %], [% unit.itemtype | html %] - issuingrule will fallback to 'days' for 'lengthunit' as it is incorrectly defined as - [% unit.lengthunit | html %]. + The [% unit.branchcode || 'branchcode=default' | html %], [% unit.categorycode || 'categorycode=default' | html %], [% unit.itemtype || 'itemtype=default' | html %] + issuingrule will fallback to 'days' for 'lengthunit' as it is incorrectly defined as + [% unit.rule_value | html %]. [% END %] -- 2.39.5