After clicking the "mapping" button on after the first page of the import wizard, I get this error:
* The selected file /home/national/public_html/tmp/recareas.txt could not be copied.
* warning: array_map() [function.array-map]: Argument #2 should be an array in /path/to/drupal/sites/all/modules/node_import/node_import.api.inc on line 115.
* warning: Invalid argument supplied for foreach() in /path/to/drupal/sites/all/modules/node_import/node_import.api.inc on line 115.
* warning: Invalid argument supplied for foreach() in /path/to/drupal/sites/all/modules/node_import/node_import.module on line 292.
I'm using Drupal 5.1, mysql 5.0.67, and php 5.2.6.
any suggestions would are appreciated.
Comments
Comment #1
dooug commentedI had this problem with Drupal 5.15 and Node import 5.x-1.9.
This is usually a permissions problem with the files and temporary folders. However, my permissions for those folders checked out.
Eventually I found in node_import.module file on line 200 shows:
// If there is an uploaded file, save it to
// drupal.node_import.{site_url}.{uid} in the temporary directory.
My problem was being caused because that temporary file ( drupal.node_import.{site_url}.{uid} ) already existed (the permissions for the file might have been change accidentally) and wasn't being overwritten. Removing the file fixed the problem.
Hopefully that helps!
Comment #2
thinguy commentedGetting this same error running 5.x-1.9 and Drupal. 5.20. I see the file is copied to my tmp folder but and it's a .csv that I've never used so it's not a duplicate.
Any solution?
Comment #3
thinguy commented* The selected file /var/www/net/tmp/test.tsv could not be copied.
* warning: array_map() [function.array-map]: Argument #2 should be an array in /var/www/net/sites/all/modules/node_import/node_import.api.inc on line 115.
* warning: Invalid argument supplied for foreach() in /var/www/net/sites/all/modules/node_import/node_import.api.inc on line 115.
* warning: Invalid argument supplied for foreach() in /var/www/net/sites/all/modules/node_import/node_import.module on line 292.
Anyone know how to fix this?
Tried multiple .csv and tsv files.
Comment #4
grip media commentedThis is a hack to make it work in a pinch, it is not a fix to the module itself...
Editing node_import.module, I went in and hard coded my site URL into the function in the module:
else if ($edit['op'] == t('Next (mapping)')) {
// If there is an uploaded file, save it to
// drupal.node_import.{site_url}.{uid} in the temporary directory.
$file = file_save_upload('file');
if ($file) {
$edit['filename'] = $file->filename;
file_move($file, 'drupal.node_import.'. strtr(YOURSITE,COM, array('http://' => '', '/' => '.')) .'.'. $user->uid, 1);
$edit['file'] = $file;
}
I put in my site where it says YOURSITE,COM (it normally says strtr($base_url, array )
note the comma.
This fixed it and it works.
This is a kludge for sure, but if you need it to work, and since no one has posted a fix... this might work for you.