diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a6cce4e7bfb..16ab5f8f1b9 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -9044,7 +9044,7 @@ class Form
*/
public static function selectArrayAjax($htmlname, $url, $id = '', $moreparam = '', $moreparamtourl = '', $disabled = 0, $minimumInputLength = 1, $morecss = '', $callurlonselect = 0, $placeholder = '', $acceptdelayedhtml = 0)
{
- global $conf, $langs;
+ global $conf;
global $delayedhtmlcontent; // Will be used later outside of this function
// TODO Use an internal dolibarr component instead of select2
@@ -9091,9 +9091,9 @@ class Form
},
cache: true
},
- language: select2arrayoflanguage,
+ language: select2arrayoflanguage || \'en\',
containerCssClass: \':all:\', /* Line to add class from the original SELECT propagated to the new tag (ok with multiselect). Need full version of select2. */
+ dropdownCssClass: \'' . dol_escape_js($morecss) . '\', /* Line to add class on the new \',
menuHTML: \'