Index: filefield.migrate.inc =================================================================== --- filefield.migrate.inc (revision 3109) +++ filefield.migrate.inc (working copy) @@ -15,7 +15,7 @@ foreach (filefield_migrate_fields_node($node->type) as $source_key => $label) { if (!empty($node->$source_key)) { - $source_file = $node->$source_key; + $source_files = $node->$source_key; $field_name = preg_replace('/_sourcefile$/', '', $source_key); $field = content_fields($field_name, $tblinfo->desttype); @@ -25,6 +25,13 @@ } $files_path = _migrate_widget_files_directory($field); + // Make an array of source files, using configured separator. + if (!is_array($source_files)) { + $source_files = explode($tblinfo->multiple_separator, $source_files); + } + + foreach ($source_files as $source_file) { + if (file_exists($source_file)) { if ($file = field_file_save_file($source_file, $validators, $files_path)) { if (!isset($node->$field_name)) { $node->$field_name = array(); @@ -35,6 +42,11 @@ $errors[] = migrate_message(t('File save failed for %file', array('%file' => $source_file))); } } + else { + $errors[] = migrate_message(t('Original data file doesn\'t exist: %file', array('%file' => $source_file))); + } + } // next $source_file + } } return $errors; }