Bugzilla – Attachment 92270 Details for
Bug 23445
Loan period unit in circulation rules is untranslatable causing problems when editing rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23445: (RM follow-up) Add warning for unexpected lengthunit
Bug-23445-RM-follow-up-Add-warning-for-unexpected-.patch (text/plain), 3.47 KB, created by
Martin Renvoize
on 2019-08-16 11:20:07 UTC
(
hide
)
Description:
Bug 23445: (RM follow-up) Add warning for unexpected lengthunit
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2019-08-16 11:20:07 UTC
Size:
3.47 KB
patch
obsolete
>From 1aae63606caeb389a40bd644b1f9e30917325573 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 16 Aug 2019 12:17:42 +0100 >Subject: [PATCH] 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> >--- > about.pl | 16 ++++++++++++++++ > .../intranet-tmpl/prog/en/modules/about.tt | 17 ++++++++++++++++- > 2 files changed, 32 insertions(+), 1 deletion(-) > >diff --git a/about.pl b/about.pl >index dacd39db2d..4738c32ad0 100755 >--- a/about.pl >+++ b/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( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 60ce4ac21d..e935a74ca4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/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 %] >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23445
:
92137
|
92240
|
92261
| 92270