From 6e168ae889f7675b658691ffc97daa51451399e7 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 349dfc9668..21665dbe1f 100755 --- a/about.pl +++ b/about.pl @@ -292,6 +292,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 2616a6efc3..aa7e7446bb 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 %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || 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 %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || warnUploadPublic %]

Warnings regarding the system configuration

@@ -305,6 +305,28 @@ System preference 'RESTOAuth2ClientCredentials' is set, but the required Net::OAuth2::AuthorizationServer dependency is missing. The feature is disabled. [% 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