mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
FIX #3534
This commit is contained in:
@@ -452,13 +452,15 @@ abstract class CommonObject
|
||||
// Check parameters
|
||||
if ($fk_socpeople <= 0)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorWrongValueForParameter","1");
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans("ErrorWrongValueForParameterX","1");
|
||||
dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
if (! $type_contact)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorWrongValueForParameter","2");
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans("ErrorWrongValueForParameterX","2");
|
||||
dol_syslog(get_class($this)."::add_contact ".$this->error,LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
@@ -486,7 +488,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$datecreate = dol_now();
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insertion dans la base
|
||||
@@ -504,7 +506,11 @@ abstract class CommonObject
|
||||
if (! $notrigger)
|
||||
{
|
||||
$result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user);
|
||||
if ($result < 0) { $this->db->rollback(); return -1; }
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
|
||||
Reference in New Issue
Block a user