소스 검색

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.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@4993 a333f486-631f-4898-b8df-5754b55c2be0
romainq 7 년 전
부모
커밋
2ea4c21013
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      core/dbobject.class.php

+ 8 - 0
core/dbobject.class.php

@@ -1726,6 +1726,14 @@ abstract class DBObject implements iDisplay
 
 
 		$this->m_bIsInDB = true;
 		$this->m_bIsInDB = true;
 		$this->m_bDirty = false;
 		$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();
 		$this->AfterInsert();