diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 4407dec6955..7c23444845b 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -679,13 +679,16 @@ class Form { if ($conf->use_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { - if ($selected) $obj = $this->db->fetch_object($resql); - $socid = $obj->rowid?$obj->rowid:''; - + $socid = 0; + if ($selected) + { + $obj = $this->db->fetch_object($resql); + $socid = $obj->rowid?$obj->rowid:''; + } print '
| ';
print ' ';
- if ($obj->rowid == 0)
+ if ($socid == 0)
{
print '';
}
|