LSldapObject: fix triggering after_modify event on create

This commit is contained in:
Benjamin Renard 2021-05-21 11:28:38 +02:00
parent 59d6d0865d
commit 4b634e408d

View file

@ -372,15 +372,18 @@ class LSldapObject extends LSlog_staticLoggerClass {
}
}
$new = $this -> isNew();
if ($this -> submitChange($idForm)) {
self :: log_debug($this."->_updateData(): changes are submited");
// Event After Modify
$this -> fireEvent('after_modify');
if (!$new && $idForm != 'create') {
$this -> fireEvent('after_modify');
// $this -> attrs[*] => After Modify
foreach($new_data as $attr_name => $attr_val) {
if ($this -> attrs[$attr_name] -> isUpdate()) {
$this -> attrs[$attr_name] -> fireEvent('after_modify');
// $this -> attrs[*] => After Modify
foreach($new_data as $attr_name => $attr_val) {
if ($this -> attrs[$attr_name] -> isUpdate()) {
$this -> attrs[$attr_name] -> fireEvent('after_modify');
}
}
}
$this -> reloadData();