N°2293 DBUpdate changes finalisation

* ListChanges are back where they were (extra precaution to prevent AfterUpdate callback impl regressions)
* aChanges reset is done after the reentrance test
This commit is contained in:
Pierre Goiffon
2019-09-17 15:06:47 +02:00
parent 5af33ffe0a
commit d83a256b9d

View File

@@ -3020,8 +3020,6 @@ abstract class DBObject implements iDisplay
throw new CoreException("DBUpdate: could not update a newly created object, please call DBInsert instead");
}
$this->m_aChanges = array(); // reset attribute to avoid stack collisions
$iNbTryRemaining = 3;
while ($iNbTryRemaining > 0)
{
@@ -3034,6 +3032,7 @@ abstract class DBObject implements iDisplay
}
$aUpdateReentrance[$sKey] = true;
$this->m_aChanges = array(); // reset attribute to avoid stack collisions
try
{
CMDBSource::Query('START TRANSACTION');
@@ -3172,13 +3171,12 @@ abstract class DBObject implements iDisplay
$this->WriteExternalAttributes();
$this->m_aChanges = $this->ListChanges(); // N°2293 save changes for use in user callbacks
$this->AfterUpdate();
$this->m_bDirty = false;
$this->m_aTouchedAtt = array();
$this->m_aModifiedAtt = array();
$this->AfterUpdate();
// Reload to get the external attributes
if ($bHasANewExternalKeyValue)
{