From 58785083d5f55d796d74a78e8fd768b46f9acdfb Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 6 May 2013 16:06:37 +0000 Subject: [PATCH] Fix for reconciliation by "id" (advanced mode) SVN:2.0[2714] --- core/bulkchange.class.inc.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/core/bulkchange.class.inc.php b/core/bulkchange.class.inc.php index 85c1b53e7..d3752fdeb 100644 --- a/core/bulkchange.class.inc.php +++ b/core/bulkchange.class.inc.php @@ -361,8 +361,15 @@ class BulkChange foreach ($aKeyConfig 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 = $aRowData[$iCol]; + } + else + { + $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]); } @@ -828,8 +835,15 @@ class BulkChange { // The value is given in the data row $iCol = $this->m_aAttList[$sAttCode]; - $oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode); - $valuecondition = $oAttDef->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues); + if ($sAttCode == 'id') + { + $valuecondition = $aRowData[$iCol]; + } + else + { + $oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $sAttCode); + $valuecondition = $oAttDef->MakeValueFromString($aRowData[$iCol], $this->m_bLocalizedValues); + } } if (is_null($valuecondition)) {