From f9df71447b42a46eb1ccc66bdd175772a785b5ec Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 11 Feb 2021 13:34:02 +0100 Subject: [PATCH] Bug 22824: Add warning to the about page Just in case, add a warning to the about page. Signed-off-by: Kyle M Hall Signed-off-by: Julian Maurice Signed-off-by: Martin Renvoize JD amended patch: there was a "bad space" between "warnNoActiveCurrency" Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- about.pl | 8 ++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/about.pl b/about.pl index a8df6aa312..376f77c6aa 100755 --- a/about.pl +++ b/about.pl @@ -201,6 +201,14 @@ my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_pat my $warnPrefKohaAdminEmailAddress = not Email::Valid->address(C4::Context->preference('KohaAdminEmailAddress')); +my $invalid_yesno = Koha::Config::SysPrefs->search( + { + type => 'YesNo', + value => { -or => { 'is' => undef, -not_in => [ "1", "0" ] } } + } +); +$template->param( invalid_yesno => $invalid_yesno ); + my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode(); my $warnIsRootUser = (! $loggedinuser); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 2aa22763f6..9d24e81334 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -207,7 +207,7 @@
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || invalid_yesno.count || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || warnConnectBroker %] [% IF (warnIsRootUser) %]

Warning regarding current user

You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.

@@ -291,7 +291,7 @@ Contact your system administrator. [% END %] - [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || paypal_enabled %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnPrefKohaAdminEmailAddress || invalid_yesno.count || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size || paypal_enabled %]

Warnings regarding the system configuration

@@ -316,6 +316,11 @@ [% IF warnPrefKohaAdminEmailAddress %] [% END %] + [% IF invalid_yesno.count %] + [% FOR p IN invalid_yesno %] + + [% END %] + [% END %] [% IF warnNoActiveCurrency %] [% END %] -- 2.39.5
Preferences and parameters
Warning System preference 'KohaAdminEmailAddress' does not contain a valid email address. Emails will not be sent.
Warning System preference '[% p.variable | html %]' must be '0' or '1', but is [% IF p.value.defined %]'[% p.value | html%]'[% ELSE %]NULL[% END %].
Warning No active currency is defined. Please go to Administration > Currencies and exchange rates and mark one currency as active.