From f254dbdb245430fd0f48fb7a82bc677e2108efb1 Mon Sep 17 00:00:00 2001
From: Tomas Cohen Arazi <tomascohen@theke.io>
Date: Thu, 29 Mar 2018 10:44:59 -0300
Subject: [PATCH] Bug 20428: Make Koha::UploadedFile use the new config entry
 for tmp files

This patch makes Koha::UploadedFile->temporary_directory try to use the
new configuration entry. It will fallback to File::Spec->tmpdir
otherwise.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
---
 Koha/UploadedFile.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Koha/UploadedFile.pm b/Koha/UploadedFile.pm
index 9df1178608..b7efa85cde 100644
--- a/Koha/UploadedFile.pm
+++ b/Koha/UploadedFile.pm
@@ -168,7 +168,7 @@ Returns root directory for temporary storage
 
 sub temporary_directory {
     my ( $class ) = @_;
-    return File::Spec->tmpdir;
+    return C4::Context->config('upload_tmp_path') || File::Spec->tmpdir;
 }
 
 =head3 _type
-- 
2.17.0