N°7080 - EVENT_DB_LINKS_CHANGED not fired when deleting a user

Fix regressions caused by deletion plan reorder
This commit is contained in:
Pierre Goiffon
2024-01-04 17:57:22 +01:00
parent 1de390a24d
commit abb3ea3272
3 changed files with 78 additions and 48 deletions

View File

@@ -6101,7 +6101,10 @@ JS
MetaModel::StartReentranceProtection($oObject);
$oObject->FireEvent(EVENT_DB_LINKS_CHANGED);
MetaModel::StopReentranceProtection($oObject);
if (count($oObject->ListChanges()) !== 0) {
// Use IsNew() === true when object is deleted
// new objects are already saved at this point (so IsNeww() will return false in this case)
if (!$oObject->IsNew() && count($oObject->ListChanges()) !== 0) {
$oObject->DBUpdate();
}
}