FIX: Fix when add or modify ressources on events with duplicate entries

This commit is contained in:
kamel 2021-04-06 16:04:30 +02:00
parent 10fb793fb1
commit c44522594a

View File

@ -590,10 +590,12 @@ class ActionComm extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$error++; $error++;
dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR); dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR);
$this->errors[] = $this->db->lasterror(); $this->errors[] = $this->db->lasterror();
} }
}
//var_dump($sql);exit; //var_dump($sql);exit;
} }
} }
@ -607,6 +609,7 @@ class ActionComm extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$error++; $error++;
dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR); dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
$this->errors[] = $this->db->lasterror(); $this->errors[] = $this->db->lasterror();
@ -614,6 +617,7 @@ class ActionComm extends CommonObject
} }
} }
} }
}
if (!$error) { if (!$error) {
// Actions on extra fields // Actions on extra fields
@ -1152,9 +1156,11 @@ class ActionComm extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$error++; $error++;
$this->errors[] = $this->db->lasterror(); $this->errors[] = $this->db->lasterror();
} }
}
//var_dump($sql);exit; //var_dump($sql);exit;
} }
} }
@ -1170,12 +1176,14 @@ class ActionComm extends CommonObject
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if (!$resql) { if (!$resql) {
if ($this->db->errno() != 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$error++; $error++;
$this->errors[] = $this->db->lasterror(); $this->errors[] = $this->db->lasterror();
} }
} }
} }
} }
}
if (!$error && !$notrigger) { if (!$error && !$notrigger) {
// Call trigger // Call trigger