I was able to upload a file and import it successfully.
I did get the following error:
Notice: Undefined property: stdClass::$tables_in_mysqldbname (import\_%) in _importer_form_start() (line 302 of /home/scarfeca/public_html/d7a/sites/all/modules/importer/importer.module).
- don't know if it matters, but my MySQL db name has an underscore in it

Anyhow, as mentioned, the data was successfully imported.
HOWEVER, when I go back to the importer, the 'List of previously created tables' select list is unpopulated.

Comments

kartelusm’s picture

Could you tell me the name of the table? Also, if it's not to much trouble, attach a sample of the data so I could debug the problem.

andjules’s picture

Sure, I'll send you a PM

andjules’s picture

StatusFileSize
new1.71 KB
new7.06 KB

scratch that, PMs don't have attachments.
tables were (automagically named) import_dailynav and import_weeklynav, where dailynav.csv and weeklynav.csv were the filenames (attached - .csv extension changed to .txt for upload). I manually entered field names in both cases, and it was smart enough to ignore the first row of weeklynav.csv.

kartelusm’s picture

I've tried to import weeklynav (also added custom column names), and everything went well. The thing I did with that file was to remove the extra one (or two) lines at the end that were empty. Then it worked perfectly and the 'List of previously created tables' showed the import_weeklynav table (import_ is a prefix that is added to the tables created trough this module).

The dailynav file has no header. You have to have a header (even if only the ,,, sequence) because the module expect it to be present. It determines the number of columns in the table by the number of elements in the header. For instance, the ,,, will create 4 empty fields on the first step of the import so you can enter the names of the columns

andjules’s picture

Thanks. that's fantastic info.
Given that the client or a 3rd party may be uploading my files, could we make it more fault-tolerant, at least of the empty lines at the end?

kartelusm’s picture

I'm planning to do something like that just as soon as I find a little time. I'll try to do it as soon as I can.

joelstein’s picture

Issue summary: View changes
StatusFileSize
new536 bytes

This error is due to MySQL returning the "SHOW TABLES LIKE" syntax with a different column name than what Importer currently expect. It's a subtle difference, but supposing your database is called "drupal", MySQL will return the table names in a column called "Tables_in_drupal (import\_%". Thus, simply changing our "t" to "T" will fix this error and populate the list of previously created tables. See the attached patch.

joelstein’s picture

Status: Active » Needs review
joelstein’s picture

Status: Fixed » Closed (fixed)

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