浏览代码

#795 Issue when using the actual (id) value of an external key as a reconciliation field

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2918 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 年之前
父节点
当前提交
550f95b8d7
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 10 3
      core/bulkchange.class.inc.php

+ 10 - 3
core/bulkchange.class.inc.php

@@ -296,9 +296,16 @@ class BulkChange
 		$oReconFilter = new CMDBSearchFilter($oExtKey->GetTargetClass());
 		foreach ($this->m_aExtKeys[$sAttCode] as $sForeignAttCode => $iCol)
 		{
-			// The foreign attribute is one of our reconciliation key
-			$oForeignAtt = MetaModel::GetAttributeDef($oExtKey->GetTargetClass(), $sForeignAttCode);
-			$value = $oForeignAtt->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues);
+			if ($sForeignAttCode == 'id')
+			{
+				$value = (int) $aRowData[$iCol];
+			}
+			else
+			{
+				// The foreign attribute is one of our reconciliation key
+				$oForeignAtt = MetaModel::GetAttributeDef($oExtKey->GetTargetClass(), $sForeignAttCode);
+				$value = $oForeignAtt->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues);
+			}
 			$oReconFilter->AddCondition($sForeignAttCode, $value, '=');
 			$aResults[$iCol] = new CellStatus_Void($aRowData[$iCol]);
 		}