Selaa lähdekoodia

Fix for reconciliation by id (Advanced Mode) -reintegrated from branch 2.0

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@2731 a333f486-631f-4898-b8df-5754b55c2be0
romainq 12 vuotta sitten
vanhempi
commit
5d4e111264
1 muutettua tiedostoa jossa 18 lisäystä ja 4 poistoa
  1. 18 4
      core/bulkchange.class.inc.php

+ 18 - 4
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))
 					{