Fix #16420 - undefined $model_mail_selected_id

Set $model_mail_selected_id to 0 when it is undefined
This commit is contained in:
daraelmin 2021-02-26 08:20:51 +01:00 committed by GitHub
parent e08bfab537
commit 5d31a93bf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -455,7 +455,7 @@ class FormMail extends Form
// Zone to select email template
if (count($modelmail_array) > 0)
{
$model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : $arraydefaultmessage->id;
$model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : ( ($arraydefaultmessage->id) ? $arraydefaultmessage->id : 0 );
// If list of template is filled
$out .= '<div class="center" style="padding: 0px 0 12px 0">'."\n";