From 8ae05a965100eb266381cbcad1ac4b65ce8e9254 Mon Sep 17 00:00:00 2001 From: Laurent Dinclaux Date: Thu, 11 May 2017 13:38:17 +1100 Subject: [PATCH] Fix: when sending a mail the default template used should be the first positionned template --- 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 231ff16c6af..e59a57d31b0 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -828,7 +828,7 @@ class FormMail extends Form if ($active >= 0) $sql.=" AND active = ".$active; if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; if (!empty($id)) $sql.= " AND rowid=".$id; - $sql.= $db->order("lang,label","ASC"); + $sql.= $db->order("position,lang,label","ASC"); //print $sql; $resql = $db->query($sql);