Skip to content

Commit

Permalink
chore: review
Browse files Browse the repository at this point in the history
  • Loading branch information
FHenry committed Dec 16, 2024
1 parent 7195af1 commit 5097572
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion htdocs/core/class/html.formticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,8 @@ public function showMessageForm($width = '40%')
$model_id = (int) $this->param["models_id"];
}

$arraydefaultmessage = $formmail->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id, 1, '', 1); // If $model_id is empty, preselect the first one
// If $model_id is empty, preselect the first one
$arraydefaultmessage = $formmail->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id, 1, '', 1);
if (isset($arraydefaultmessage->id) && empty($model_id)) {
$model_id = $arraydefaultmessage->id;
$this->param['models_id']=$model_id;
Expand Down Expand Up @@ -1612,6 +1613,12 @@ public function showMessageForm($width = '40%')
print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
}

// Get message template
$model_id = 0;
if (array_key_exists('models_id', $this->param)) {
$model_id = $this->param["models_id"];
$arraydefaultmessage = $formmail->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id, 1, '', 1);
}
$result = $formmail->fetchAllEMailTemplate(!empty($this->param["models"]) ? $this->param["models"] : "", $user, $outputlangs);
if ($result < 0) {
setEventMessages($this->error, $this->errors, 'errors');
Expand Down

0 comments on commit 5097572

Please sign in to comment.