From 5d31a93bf0b4215e4b8009b63bf87bdf83915dbc Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 26 Feb 2021 08:20:51 +0100 Subject: [PATCH] Fix #16420 - undefined $model_mail_selected_id Set $model_mail_selected_id to 0 when it is undefined --- 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 2b551ed14d1cb..729be941d518c 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -455,7 +455,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove // 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 .= '
'."\n";