From 8795ca508e88875da3d6448eec333a0acea702dd Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Fri, 28 Sep 2018 18:11:42 +0200 Subject: [PATCH] Bugfix upload --- src/HTMLBuilder/Manager/FileManager.php | 2 +- src/Uploads.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/HTMLBuilder/Manager/FileManager.php b/src/HTMLBuilder/Manager/FileManager.php index b6ee8770c..7af2ef889 100644 --- a/src/HTMLBuilder/Manager/FileManager.php +++ b/src/HTMLBuilder/Manager/FileManager.php @@ -121,7 +121,7 @@ class FileManager implements ManagerInterface if (!$options['readonly']) { $result .= ' - + '; } diff --git a/src/Uploads.php b/src/Uploads.php index d1257ed76..0bc18f046 100644 --- a/src/Uploads.php +++ b/src/Uploads.php @@ -196,7 +196,7 @@ class Uploads $name = $database->selectOne('zz_files', ['name'], [ 'filename' => $filename, - 'id_module' => !empty($data['id_module']) ? $data['id_module'] : null, + 'id_module' => !empty($data['id_module']) && empty($data['id_plugin']) ? $data['id_module'] : null, 'id_plugin' => !empty($data['id_plugin']) ? $data['id_plugin'] : null, 'id_record' => $data['id_record'], ])['name']; @@ -214,7 +214,7 @@ class Uploads if (delete($files)) { $database->delete('zz_files', [ 'filename' => $fileinfo['basename'], - 'id_module' => !empty($data['id_module']) ? $data['id_module'] : null, + 'id_module' => !empty($data['id_module']) && empty($data['id_plugin']) ? $data['id_module'] : null, 'id_plugin' => !empty($data['id_plugin']) ? $data['id_plugin'] : null, 'id_record' => $data['id_record'], ]);