diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index a99af668fd8..cf55a4366d1 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -524,13 +524,13 @@ class FormOther
if (!empty($user->socid)) {
$sql_usr .= " AND u.fk_soc = ".((int) $user->socid);
}
- if (getDolGlobalString('USER_HIDE_NONEMPLOYEE_IN_COMBOBOX')) {
+ if (getDolUserString('USER_HIDE_NONEMPLOYEE_IN_COMBOBOX', getDolGlobalString('USER_HIDE_NONEMPLOYEE_IN_COMBOBOX'))) {
$sql_usr .= " AND u.employee <> 0";
}
- if (getDolGlobalString('USER_HIDE_EXTERNAL_IN_COMBOBOX')) {
+ if (getDolUserString('USER_HIDE_EXTERNAL_IN_COMBOBOX', getDolGlobalString('USER_HIDE_EXTERNAL_IN_COMBOBOX'))) {
$sql_usr .= " AND u.fk_soc IS NULL";
}
- if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX')) {
+ if (getDolUserString('USER_HIDE_INACTIVE_IN_COMBOBOX', getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX'))) { // Can be set in setup of module User.
$sql_usr .= " AND u.statut <> 0";
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 15220ea3f5f..762910dc8dd 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -249,7 +249,7 @@ function getDolUserString($key, $default = '', $tmpuser = null)
$tmpuser = $user;
}
- return (string) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key);
+ return (string) (isset($tmpuser->conf->$key) ? $tmpuser->conf->$key : $default);
}
/**
@@ -267,7 +267,7 @@ function getDolUserInt($key, $default = 0, $tmpuser = null)
$tmpuser = $user;
}
- return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key);
+ return (int) (isset($tmpuser->conf->$key) ? $tmpuser->conf->$key: $default);
}