Forráskód Böngészése

Bug fix: properly process field names followed by a star (which simply indicates an important field in the CSV import)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1395 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 éve
szülő
commit
fe683f1080
1 módosított fájl, 6 hozzáadás és 5 törlés
  1. 6 5
      webservices/import.php

+ 6 - 5
webservices/import.php

@@ -422,6 +422,12 @@ try
 	foreach($aRawFieldList as $iFieldId => $sFieldName)
 	{
 		$sFieldName = trim($sFieldName);
+		$aMatches = array();
+		if (preg_match('/^(.+)\*$/', $sFieldName, $aMatches))
+		{
+			// Ignore any trailing "star" (*) that simply indicates a mandatory field
+			$sFieldName = $aMatches[1];
+		}
 		if (array_key_exists(strtolower($sFieldName), $aFriendlyToInternalAttCode))
 		{
 			$aFieldList[$iFieldId] = $aFriendlyToInternalAttCode[strtolower($sFieldName)];
@@ -437,11 +443,6 @@ try
 	foreach($aFieldList as $iFieldId => $sFieldName)
 	{
 		$aMatches = array();
-		if (preg_match('/^(.+)\*$/', $sFieldName, $aMatches))
-		{
-			// Ignore any trailing "star" (*) that simply indicates a mandatory field
-			$sFieldName = $aMatches[1];
-		}
 		if (preg_match('/^(.+)->(.+)$/', trim($sFieldName), $aMatches))
 		{
 			// The column has been specified as "extkey->attcode"