Downloaded latest version for 4.74, installed module, and ran update.php. I've tried both the upload and the ftp imports. Both ways I get the following errors:

* user warning: Unknown column 'filename' in 'field list' query: INSERT INTO user_import (name, filename, oldfilename, filepath, started, pointer, processed, valid, first_line_skip, contact, username_space, send_email, field_match, roles, options, setting) VALUES ('', 'revFendors.csv', 'revFendors.csv', 'sites/default/modules/user_import/revFendors.csv', 1169313235, 0, 0, 0, 0, 0, 0, 0, 'N;', 'N;', 'a:4:{s:6:\"groups\";N;s:7:\"subject\";N;s:7:\"message\";N;s:8:\"activate\";N;}', 'file set') in /home/mallee/public_html/includes/database.mysql.inc on line 121.
* Could not find the csv file ''
* warning: fgetcsv() expects parameter 1 to be resource, string given in /home/mallee/public_html/sites/default/modules/user_import/user_import.module on line 1509.

From what I could determine, the unrecognized line endings was a problem with Excel running on Mac. However, I am using Excel (ver 2002) running on Windows XP. Besides saving the file as "cvs", I also tried saving the file as "cvs dos".

A fix may possibly be including PHP's auto_detect_line_endings

OR (PHP newbie here, but took courses in C and C++ programming) user_import.module line 1492's function _user_import_file_open uses fopen to open the file, but doesn't close the file with fclose?

Comments

robert castelo’s picture

You need to save the csv file as 'csv(windows)' before import.

MsDetta’s picture

My Excel options are:

1. Comma delimited CSV (*.csv)
2. CSV (MacIntosh) (*.csv)
3. CSV (MS-DOS) (*.csv)

I would assume that #1 is Windows. As I stated previously, I tried both options #1 and #3 and received the the same error with both types of csv files.

MsDetta’s picture

By the way, I didn't have any problems importing csv file into tablemanager.module import csv function.

MsDetta’s picture

The sample CSV file does not work. Same error as above:

user warning: Unknown column 'filename' in 'field list' query: INSERT INTO user_import (name, filename, oldfilename, filepath, started, pointer, processed, valid, first_line_skip, contact, username_space, send_email, field_match, roles, options, setting) VALUES ('', 'sample.csv', 'sample.csv', 'sites/default/modules/user_import/sample.csv', 1169570683, 0, 0, 0, 0, 0, 0, 0, 'N;', 'N;', 'a:4:{s:6:\"groups\";N;s:7:\"subject\";N;s:7:\"message\";N;s:8:\"activate\";N;}', 'file set') in /home/mallee/public_html/includes/database.mysql.inc on line 121.

Could not find the csv file ''

warning: fgetcsv() expects parameter 1 to be resource, string given in /home/mallee/public_html/sites/default/modules/user_import/user_import.module on line 1509.

Is there any possible way to unistall the 4.7.x-01 update and go back to HEAD version?

MsDetta’s picture

I managed to uninstall the 4.7x version and reinstalled the HEAD version. With HEAD version I don't have any problems using a CSV file.

mandclu’s picture

Version: 4.7.x-1.0 » 5.x-1.3

I had issues with it sometime not recognizing line endings (don't want the end users to always need an extra step to save into Windows format), so I added the following to the start of _user_import_file_open:
ini_set("auto_detect_line_endings", 1);

Worked like a charm for me.

robert castelo’s picture

Status: Active » Fixed

Fixed in 5.x-2.0-beta3.

Added:

ini_set('auto_detect_line_endings', true);

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.