#Fix #16767 unremovable attached file in mailmodel

#Fix #16767 make default attached file of a mail model selected removable
This commit is contained in:
daraelmin 2021-03-20 14:10:56 +01:00 committed by GitHub
parent b66173a111
commit cb71936ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -417,7 +417,7 @@ class FormMail extends Form
$listofmimes = array();
$keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined
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')) {
if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) {
foreach ($this->param['fileinit'] as $file) {
$this->add_attached_files($file, basename($file), dol_mimetype($file));