diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 222e63205a..1e8ab83ccc 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -3271,13 +3271,18 @@ abstract class DBObject implements iDisplay $this->DBWriteLinks(); $this->WriteExternalAttributes(); - if (count($aChanges) != 0) - { + // following lines are resetting changes (so after this {@see DBObject::ListChanges()} won't return changes anymore) + // new values are already in the object (call {@see DBObject::Get()} to get them) + // call {@see DBObject::ListPreviousValuesForUpdatedAttributes()} to get changed fields and previous values + $this->m_bDirty = false; + $this->m_aTouchedAtt = array(); + $this->m_aModifiedAtt = array(); + + if (count($aChanges) != 0) { $this->RecordAttChanges($aChanges, $aOriginalValues); } - if ($bIsTransactionEnabled) - { + if ($bIsTransactionEnabled) { CMDBSource::Query('COMMIT'); } break;