From df6fcf40c228e83310c7b7abd507159a70682314 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Wed, 1 Dec 2021 16:51:07 +0100 Subject: [PATCH] Fixed compat with the notification center for temporary uploads --- MPFormsFormManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MPFormsFormManager.php b/MPFormsFormManager.php index 004b3e9..0741cdf 100644 --- a/MPFormsFormManager.php +++ b/MPFormsFormManager.php @@ -319,14 +319,18 @@ public function storeData(array $submitted, array $labels, array $files) // If the user marked the form field to upload the file into // a certain directory, this check will return false and thus // we won't move anything. + if (is_uploaded_file($file['tmp_name'])) { - $target = sprintf('%s/system/tmp/mp_forms_%s.%s', - TL_ROOT, + $target = sprintf('%s/mp_forms_%s.%s', + sys_get_temp_dir(), basename($file['tmp_name']), $this->guessFileExtension($file) ); move_uploaded_file($file['tmp_name'], $target); $files[$k]['tmp_name'] = $target; + + // Compatibility with notification center + $files[$k]['uploaded'] = true; } }