From c41b59b14c59f9c33c37359e9b17ed71713f59c2 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 4 Mar 2021 14:23:08 +0100 Subject: [PATCH] Fix : when we have got models in database attached files are cleared even if we did not have selected a model --- htdocs/core/class/html.formmail.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index d19269ffd5f..b5f1b34b899 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -332,7 +332,7 @@ class FormMail extends Form $langs->loadLangs(array('other', 'mails')); // Clear temp files. Must be done at beginning, before call of triggers - if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) + if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { $this->clear_attached_files(); }