Skip to content
Snippets Groups Projects
Commit 2f593202 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

More information returned into return code

parent 14f85dc8
No related branches found
No related tags found
No related merge requests found
......@@ -2049,7 +2049,7 @@ abstract class CommonObject
*
* @param int $rowid Id of line
* @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label()
* @return void
* @return int <0 if error, 0 if no optionals to find nor found, 1 if a line is found and optionnal loaded
*/
function fetch_optionals($rowid,$optionsArray='')
{
......@@ -2077,7 +2077,8 @@ abstract class CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
if ($this->db->num_rows($resql))
$numrows=$this->db->num_rows($resql);
if ($numrows)
{
$tab = $this->db->fetch_array($resql);
......@@ -2093,12 +2094,17 @@ abstract class CommonObject
}
$this->db->free($resql);
if ($numrows) return $numrows;
else return 0;
}
else
{
dol_print_error($this->db);
return -1;
}
}
return 0;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment