Fix fetchCommon should return 0 iso error if not found

This commit is contained in:
fappels 2018-01-15 11:21:24 +01:00
parent d6ed968c51
commit 00185bd9d4

View File

@ -6299,23 +6299,15 @@ abstract class CommonObject
$res = $this->db->query($sql); $res = $this->db->query($sql);
if ($res) if ($res)
{ {
if ($obj = $this->db->fetch_object($res)) $obj = $this->db->fetch_object($res);
if ($obj)
{ {
if ($obj) $this->setVarsFromFetchObj($obj);
{ return $this->id;
$this->setVarsFromFetchObj($obj);
return $this->id;
}
else
{
return 0;
}
} }
else else
{ {
$this->error = $this->db->lasterror(); return 0;
$this->errors[] = $this->error;
return -1;
} }
} }
else else