From a9fa2ef8c1eb88453bfb916aea89d06b9ab1b731 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 29 Mar 2018 10:45:30 -0300 Subject: [PATCH] Bug 20428: Make about.pl inform about missing upload_tmp_path entry This patch makes about.pl warn about a missing upload_tmp_path entry in koha-conf.xml. It also mentions the effectively used tmp dir. Signed-off-by: Kyle M Hall Signed-off-by: Mark Tompsett --- about.pl | 8 ++++++++ koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/about.pl b/about.pl index 3997d49..587d85f 100755 --- a/about.pl +++ b/about.pl @@ -45,6 +45,7 @@ use Koha::Caches; use Koha::Config::SysPrefs; use Koha::Illrequest::Config; use Koha::SearchEngine::Elasticsearch; +use Koha::UploadedFiles; use C4::Members::Statistics; @@ -259,6 +260,13 @@ if ( ! defined C4::Context->config('upload_path') ) { } } +if ( ! defined C4::Context->config('upload_tmp_path') ) { + push @xml_config_warnings, { + error => 'uploadtmppath_entry_missing', + effective_upload_tmp_dir => Koha::UploadedFile->temporary_directory + } +} + # 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 c35a01e..c0dbb19 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -409,6 +409,14 @@ Also note that you need to properly set the OPACBaseURL preference for the file upload plugin to work. + [% ELSIF config_entry.error == 'uploadtmppath_entry_missing' %] + + Warning + You are missing the <upload_tmp_path> entry in your koha-conf.xml file. Please + add it, pointing to the configured temporary file upload directory for your Koha instance. + The effective temporary file upload directory is '[% config_entry.effective_upload_tmp_dir %]' + + [% END %] [% END %] -- 2.1.4