FIX: contact deletion: execute trigger before really deleting
This commit is contained in:
parent
02cad2c23e
commit
787de2fd8a
@ -1208,6 +1208,15 @@ class Contact extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('CONTACT_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Get all rowid of element_contact linked to a type that is link to llx_socpeople
|
||||
$sql = "SELECT ec.rowid";
|
||||
@ -1298,15 +1307,6 @@ class Contact extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('CONTACT_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user