From 677cc2b19e8e25982dc5453a1f126c080e57dae6 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Wed, 16 Oct 2013 08:54:22 +0000 Subject: [PATCH] #795 Issue when using the actual (id) value of an external key as a reconciliation field SVN:trunk[2918] --- core/bulkchange.class.inc.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index 224599e63..1fb9e8aae 100644 --- a/core/bulkchange.class.inc.php +++ b/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]); }