Index: trunk/kernel/units/general/cat_dbitem_export.php =================================================================== diff -u -N -r5431 -r5514 --- trunk/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 5431) +++ trunk/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 5514) @@ -783,6 +783,10 @@ $item_id = $this->Conn->GetOne($sql); } $save_method = $item_id && $this->curItem->Load($item_id) ? 'Update' : 'Create'; + if ($save_method == 'Update') { + // replace id from csv file with found id + $record_data[ array_search($this->curItem->IDField, $this->exportFields) ] = $item_id; + } } $this->setImportData($record_data); @@ -818,9 +822,13 @@ /*function saveLog($msg) { - $fp = fopen(FULL_PATH.'/sqls.log', 'a'); + static $first_time = true; + + $fp = fopen(FULL_PATH.'/sqls.log', $first_time ? 'w' : 'a'); fwrite($fp, $msg."\n"); fclose($fp); + + $first_time = false; }*/ /**