Fix : when we have got models in database attached files are cleared even if we did not have selected a model

This commit is contained in:
atm-greg 2021-03-04 14:23:08 +01:00
parent ef789376e7
commit c41b59b14c

View File

@ -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();
}