I just installed File import. It finds the files in my /import folder just fine, but it does not import them. I get this message:
warning: Invalid argument supplied for foreach() in /webroot/s/g/sgamm001/www/stc-ctf/includes/form.inc on line 949.
Also, no nodes are listed in the dropdown.
Is there something that I did wrong?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | file_import-294054.patch | 877 bytes | xurizaemon |
| #6 | 294054-type_uploads_allowed.patch | 651 bytes | xurizaemon |
Comments
Comment #1
jsgammato commentedps The screen is too wide for the page, too. There's obviously something screwy in the interface, but I can find no documentation to help me work through this issue.
Comment #2
johnhanley commentedI just installed this module and used it successfully. In fact, it works like a charm. If you're experiencing problems, try checking the names of your files. One or more of them might contain some funky character that's throwing the above error.
Comment #3
kingandyI experienced this too, until I opened the 'page' content type and saved it. I expect you have an empty "ID - Title" dropdown as well? (EDIT: Oh, I guess you said that you do in the original post...)
I believe this may be due to file_import not anticipating the default "allow file attachments" settings. If the content type's settings page has never been saved, the 'file attachments' setting will not actually exist - the file upload module using an internal default of 'true' for the 'page' content type - so file_import can't find any content types with file attachments enabled.
An easier alternative to rummaging around with the defaults would be to provide a more useful error message than 'no files were imported'. Certainly it should be noted whether a file attachment has been rejected due to the node type not supporting attachments, or due to a non-existent node ID, or some other reason.
Comment #4
kingandyAlso, the page being too wide is a natural result of using text fields and arbitrary filenames in rows of a table.
Comment #5
emdalton commentedThanks, this answer helped me, too. Once I opened and resaved the Page content type, I was able to import. I think at minimum it would be a good idea to put a note about this on the configuration page for the File Import module.
Comment #6
xurizaemonA popular alternative to documenting broken behaviour is ... fixing the problem :)
I noticed this bug also when porting this module to D6, so here's the patch against 5.x for that issue alone.
The per-contenttype 'upload_page' (and 'upload_blog', 'upload_story' etc) variable only gets saved when the content type is edited, so this module will not function on a default Drupal install with a single node added.
Otherwise, no nodes are made available to attach the files to.
I have not tested this code extensively, but can confirm that it worked for me.
It's intended to reverse the test for whether upload_page and friends are set. Previously, file_import did
but instead, this patch makes it do
Comment #7
xurizaemonPatch to fix this issue attached.
(Reposting; my original patch comments didn't appear in the issue updates, and there seem to be a few people waiting on this fix.)
Comment #8
xurizaemonApologies - either my internet connection or D.O is flaking today, causing form submissions to appear unresponsive. I blame the internet this end. And the ducks.
Comment #9
neochief commentedFixed in 5x-1.1 and 6.x-beta1