mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°8139 - Avoid double writing in lifecycle action
This commit is contained in:
@@ -4556,7 +4556,7 @@ abstract class DBObject implements iDisplay
|
||||
$bSuccess = true;
|
||||
// Prevent current object from being updated by the actions
|
||||
$this->AddCurrentObjectInCrudStack('APPLY_STIMULUS');
|
||||
MetaModel::StartReentranceProtection($this);
|
||||
$bIsNewlyProtected = MetaModel::StartReentranceProtection($this);
|
||||
try {
|
||||
foreach ($aTransitionDef['actions'] as $actionHandler) {
|
||||
if (is_string($actionHandler)) {
|
||||
@@ -4610,7 +4610,10 @@ abstract class DBObject implements iDisplay
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
MetaModel::StopReentranceProtection($this);
|
||||
if ($bIsNewlyProtected) {
|
||||
// Stops protection only if the object was not already protected
|
||||
MetaModel::StopReentranceProtection($this);
|
||||
}
|
||||
$this->RemoveCurrentObjectInCrudStack();
|
||||
}
|
||||
if ($bSuccess)
|
||||
|
||||
Reference in New Issue
Block a user