Browse Source

Bug 23445: (RM follow-up) Add warning for unexpected lengthunit

Discussions on this bug highlighted worries about behind the scenes
fallbacks to 'days' as a lengthunit should the lengthunit be set to an
unrecognised value. This patch adds a warning to the about page for any
such occurrences so librarians may be made aware of and resolve the issue.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
remotes/origin/19.11.x
Martin Renvoize 5 years ago
parent
commit
1aae63606c
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 16
      about.pl
  2. 17
      koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

16
about.pl

@ -444,6 +444,22 @@ $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 => {} }
);
if (@$units) {
$template->param(
warnIssuingRules => 1,
ir_units => $units,
);
}
}
my %versions = C4::Context::get_versions();
$template->param(

17
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

@ -229,7 +229,7 @@
<br/>
[% END %]
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs %]
[% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %]
<h2>Warnings regarding the system configuration</h2>
<table>
<caption>Preferences and parameters</caption>
@ -383,6 +383,21 @@
</table>
[% END %]
[% IF warnIssuingRules %]
<table>
<caption>Issuing rules</caption>
[% FOREACH unit IN ir_units %]
<tr>
<th scope="row"><b>Warning</b></th>
<td>The [% unit.branchcode | html %], [% unit.categorycode | html %], [% unit.itemtype %]
issuingrule will fallback to 'days' for 'lengthunit' as it is incorrectly defined as
[% unit.lengthunit | html %].
</td>
</tr>
[% END %]
</table>
[% END %]
[% ELSE %]
<p>No warnings.</p>
[% END %]

Loading…
Cancel
Save