diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index e70337e195d..945897856f2 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8129,7 +8129,7 @@ class Form
//if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
//if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
//if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
- $sql .= "ORDER BY p.ref, f.ref ASC";
+ $sql .= " ORDER BY p.ref, f.ref ASC";
$resql = $this->db->query($sql);
if ($resql)