Fixed integration issue (possibly a regression): if an extension implements iApplicationExtension::OnDBInsert, and it calls DBWrite, then a fatal error occurs (call a member function on a null value). The error occurs for several types of attributes such as ormCustomField, ormCaseLog, ormLinkSet. The fix consists in aligning the internal values of a DBObject as soon as it has been written into the Database.

SVN:trunk[4993]
This commit is contained in:
Romain Quetiez
2017-10-06 14:06:01 +00:00
parent 49b6c3bed7
commit 635e7cfeec

View File

@@ -1726,6 +1726,14 @@ abstract class DBObject implements iDisplay
$this->m_bIsInDB = true;
$this->m_bDirty = false;
foreach ($this->m_aCurrValues as $sAttCode => $value)
{
if (is_object($value))
{
$value = clone $value;
}
$this->m_aOrigValues[$sAttCode] = $value;
}
$this->AfterInsert();