From fc0f6b636e49dc25c2e3bcd7fd7ed99caae3ed48 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 26 Apr 2011 15:24:13 +0000 Subject: [PATCH] Data sync: fixed issue with the check while creating a new data source (depending on the target class) SVN:trunk[1237] --- core/dbobject.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/dbobject.class.php b/core/dbobject.class.php index d50a55730..bb6b8e4bb 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -110,12 +110,13 @@ abstract class DBObject // Returns an Id for memory objects static protected function GetNextTempId($sClass) { - if (!array_key_exists($sClass, self::$m_aMemoryObjectsByClass)) + $sRootClass = MetaModel::GetRootClass($sClass); + if (!array_key_exists($sRootClass, self::$m_aMemoryObjectsByClass)) { - self::$m_aMemoryObjectsByClass[$sClass] = 0; + self::$m_aMemoryObjectsByClass[$sRootClass] = 0; } - self::$m_aMemoryObjectsByClass[$sClass]++; - return (- self::$m_aMemoryObjectsByClass[$sClass]); + self::$m_aMemoryObjectsByClass[$sRootClass]++; + return (- self::$m_aMemoryObjectsByClass[$sRootClass]); } public function __toString()