Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Unable to import using a csv file. The following errors are reported:
- Notice: Undefined property: stdClass::$uri in taxonomy_csv_import_form_validate() (line 838 of /sites/all/modules/taxonomy_csv/import/taxonomy_csv.import.admin.inc).
- Source choice should be a text, an url or a file path and source content should not be empty.
- No term to import.
When I looked at the code, I see that file_save_upload(...) is being called. I checked the returned object $file, and $file->uri is not being set. That causes $options['file'] not to be set (see below) and results in the above errors.
case 'file':
$options['text'] = '';
$options['url'] = '';
// When source is path, need to preload here.
$file = file_save_upload('file', array('file_validate_extensions' => array('csv txt')));
// fopen and fseek need a real path.
if (!empty($file)) {
$file->filepath = drupal_realpath($file->uri);
if (!empty($file->filepath)) {
$options['file'] = $file;
}
}
break;
I'm puzzled because this module works for many users. I'm running Drupal 7.32. Thank you.