From cef2dd180f9770e3b2f8d28c8357fab8851bf1c2 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 7 Aug 2015 16:22:22 -0300 Subject: [PATCH] Bug 6874: (QA followup) Warnings in about page This patch introduces checks on the about.pl page so the user is warned for a deficient configuration. Signed-off-by: Tomas Cohen Arazi --- about.pl | 14 ++++++++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/about.pl b/about.pl index 847dc2b073..29777cf5cf 100755 --- a/about.pl +++ b/about.pl @@ -34,6 +34,7 @@ use C4::Context; use C4::Installer; use Koha; +use Koha::Config::SysPrefs; #use Smart::Comments '####'; @@ -157,6 +158,19 @@ if ( ! defined C4::Context->config('log4perl_conf') ) { } } +if ( ! defined C4::Context->config('upload_path') ) { + if ( Koha::Config::SysPrefs->find('OPACBaseURL')->value ) { + # OPACBaseURL seems to be set + push @xml_config_warnings, { + error => 'uploadpath_entry_missing' + } + } else { + push @xml_config_warnings, { + error => 'uploadpath_and_opacbaseurl_entry_missing' + } + } +} + # Test QueryParser configuration sanity if ( C4::Context->preference( 'UseQueryParser' ) ) { # Get the QueryParser configuration file name diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 0163c5beb4..4a06fe445f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -236,6 +236,21 @@ add it, pointing to the log4perl.conf file for your Koha instance. + [% ELSIF config_entry.error == 'uploadpath_entry_missing' %] + + Warning + You are missing the <upload_path> entry in your koha-conf.xml file. Please + add it, pointing to the configured file upload directory for your Koha instance. + + + [% ELSIF config_entry.error == 'uploadpath_and_opacbaseurl_entry_missing' %] + + Warning + You are missing the <upload_path> entry in your koha-conf.xml file. Please + add it, pointing to the configured file upload directory for your Koha instance. + Also note that you need to properly set the OPACBaseURL preference for the file upload plugin to work. + + [% END %] [% END %] -- 2.39.5