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

SVN:trunk[1395]
This commit is contained in:
Denis Flaven
2011-07-31 09:30:55 +00:00
parent 4293230416
commit c8b6ec08e7

View File

@@ -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"