mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 10:08:45 +02:00
N°4756 - ✅ Ease extensibility for CRUD operations : Add unit tests
This commit is contained in:
@@ -3345,10 +3345,12 @@ abstract class DBObject implements iDisplay
|
||||
$this->m_bDirty = false;
|
||||
$this->m_aTouchedAtt = array();
|
||||
$this->m_aModifiedAtt = array();
|
||||
|
||||
$bModifiedByUpdateDone = false;
|
||||
try {
|
||||
$this->EventUpdateDone($aChanges);
|
||||
$this->AfterUpdate();
|
||||
// Save the status as it is reset just after...
|
||||
$bModifiedByUpdateDone = $this->IsModified();
|
||||
|
||||
// Reset original values although the object has not been reloaded
|
||||
foreach ($this->m_aLoadedAtt as $sAttCode => $bLoaded) {
|
||||
@@ -3388,7 +3390,7 @@ abstract class DBObject implements iDisplay
|
||||
MetaModel::StopReentranceProtection(Metamodel::REENTRANCE_TYPE_UPDATE, $this);
|
||||
}
|
||||
|
||||
if ($this->IsModified()) {
|
||||
if ($this->IsModified() || $bModifiedByUpdateDone) {
|
||||
// Controlled reentrance
|
||||
$this->DBUpdate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user