Merge pull request #16178 from werewolf7160/patch-1
call to createCommon() return int and not bool
This commit is contained in:
commit
91996378d9
@ -203,7 +203,7 @@ class MyModuleApi extends DolibarrApi
|
||||
foreach ($request_data as $field => $value) {
|
||||
$this->myobject->$field = $value;
|
||||
}
|
||||
if (!$this->myobject->create(DolibarrApiAccess::$user)) {
|
||||
if ($this->myobject->create(DolibarrApiAccess::$user)<0) {
|
||||
throw new RestException(500, "Error creating MyObject", array_merge(array($this->myobject->error), $this->myobject->errors));
|
||||
}
|
||||
return $this->myobject->id;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user