From a94a0e23a044ad5a9163a5c9ad65fe8ad5886940 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 4 Apr 2019 14:11:51 -0300 Subject: [PATCH] Bug 22508: Add warnings to about page --- about.pl | 24 ++++++++++++++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 26 ++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/about.pl b/about.pl index b5edf5689f..a2d850b1f1 100755 --- a/about.pl +++ b/about.pl @@ -293,6 +293,30 @@ if ( C4::Context->preference('ILLModule') ) { $template->param( warnILLConfiguration => $warnILLConfiguration ); } +my $upload_public_path = C4::Context->config('upload_public_path'); +my $upload_public_url = C4::Context->config('upload_public_url'); +if ( $upload_public_path or $upload_public_url ) { + my $warnUploadPublic; + + if ( $upload_public_path and not $upload_public_url ) { + $warnUploadPublic = 1; + $template->param(upload_public_url_not_defined => 1); + }elsif( not $upload_public_path and $upload_public_url ) { + $warnUploadPublic = 1; + $template->param(upload_public_path_not_defined => 1); + } + if ( ! -d $upload_public_path ) { + $warnUploadPublic = 1; + $template->param(upload_public_path_not_created => 1); + } + elsif( ! -w $upload_public_path ) { + $warnUploadPublic = 1; + $template->param(upload_public_path_not_writable => 1); + } + + $template->param(warnUploadPublic => $warnUploadPublic); +} + if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) { # Check ES configuration health and runtime status diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 7aa2584066..a03a3f9a63 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -183,7 +183,7 @@
- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs | warnUploadPublic %] [% 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.

@@ -228,7 +228,7 @@
[% 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 | warnUploadPublic %]

Warnings regarding the system configuration

@@ -310,6 +310,28 @@ Some system preferences have badly formatted YAML content: [% bad_yaml_prefs.join(', ') | html %] [% END %] + [% IF warnUploadPublic %] + [% IF upload_public_url_not_defined %] + + [% END %] + [% IF upload_public_path_not_defined %] + + [% END %] + [% IF upload_public_path_not_created %] + + [% END %] + [% IF upload_public_path_not_writable %] + + [% END %] + [% END %]
Preferences and parameters
Warning + The configuration entry 'upload_public_url' is not defined in koha-conf.xml but 'upload_public_path' is. The feature is disabled. +
Warning + The configuration entry 'upload_public_path' is not defined in koha-conf.xml but 'upload_public_url' is. The feature is disabled. +
Warning + The configuration entry 'upload_public_path' is defined but the value does not point to an existing local directory. +
Warning + The configuration entry 'upload_public_path' is defined but the value does not point to a writable local directory. +
[% END %] -- 2.11.0