Bug 20428: Make about.pl inform about missing upload_tmp_path entry
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 29 Mar 2018 13:45:30 +0000 (10:45 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 14 May 2018 13:36:38 +0000 (10:36 -0300)
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 <kyle@bywatersolutions.com>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index b3cad66..6fdb578 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -46,6 +46,7 @@ use Koha::Caches;
 use Koha::Config::SysPrefs;
 use Koha::Illrequest::Config;
 use Koha::SearchEngine::Elasticsearch;
+use Koha::UploadedFiles;
 
 use C4::Members::Statistics;
 
@@ -260,6 +261,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
index abcd8c3..0e462b6 100644 (file)
                         Also note that you need to properly set the OPACBaseURL preference for the file upload plugin to work.
                     </td>
                 </tr>
+                [% ELSIF config_entry.error == 'uploadtmppath_entry_missing' %]
+                <tr>
+                    <th scope="row"><b>Warning</b></th>
+                    <td>You are missing the &lt;upload_tmp_path&gt; 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 %]'
+                    </td>
+                </tr>
                 [% END %]
             [% END %]
             </table>