Although all of my images in the /sites/default/files/images/import folder appear on the import page, when I try to import, everything behaves as expected, but the result is 0 images being imported. I've checked the obvious configuration of the field.

I'm using MAMP and Drupal 6.14 and have tried various rollbacks and dev releases of CCK and related modules, but no joy.

Any ideas?

Comments

hillmark’s picture

By the way, I'm doing this as user 1 (admin), hoping that as a test case this would mean no permissions issues to worry about.

escoles’s picture

I believe this is a problem with image upload size limits. Specifically, with the 'Maximum Upload Size' in the Image module settings. (/admin/settings/image)

On my first try, import failed because I was exceeding maximum upload size for the IMAGE module (set to the default).

I set the size value to '0' because that's often shorthand for 'unlimited.' Got the behavior you describe.

Set the value to 1048576 KB (100MB) and images were all imported successfully. (Were not deleted after import, but I believe I have permissions issues on my tmp directory so I'm not concerned about that.)

EDIT: No, I was wrong. I confused "Import Images" with "Image Import." When I use the correct one, I get the same behavior. So, this is not tied to maximum upload size.

escoles’s picture

Additional information: When I get this error, each file also shows "NOT WRITEABLE" adjacent to the filename.

hillm, do you get that?

about to go double-check the permissions on that directory.

escoles’s picture

Additional information on the failure mode I'm seeing (hillm, please let me know if this is what you see -- if not I'll go make another issue).

I've made sure that all files are writable (the legend next to the file changes from "NOT WRITEABLE" to "WRITEABLE"). When I try to import I get the status message "0 images imported" and the following error:

The selected file FCR Scarlet_029.jpg could not be saved. Only files with the following extensions are allowed: txt

hillmark’s picture

Escoles, you need to ensure that the CCK field is configured to accept image file types such as jgp or png. txt is default and partially explains your error.

The 'writeable' legend appears, and all folder permissions are correct, but the import is still failing with a "0 images imported" message.

escoles’s picture

Very Interesting. "txt" was not actually listed as an acceptable type. PNG, JPG, JPEG and GIF were.

I added TIF and TIFF, got an error on submit, deleted them, submitted again, and now the uploads work.

When I first created the field I had forgotten to set the widget type to "image"; I'd gone back to set that after the fact. The file extension settings must not have gotten changed in the database. I should figure that out and post it in the CCK queue...

At the same time, I had disabled "Set node status during import" on the Imagefield Import advanced settings. I thought that might have been the cause; however, when I re-enabled it, I was again able to import without difficulty.

So, maybe you could try toggling the "set node status..." value and see what happens. (I know, it's the equivalent of walking around your chair three times chanting "Bgawk! Bgawk! Bgawk!" But what if it actually works?)

(Aside: I now notice that the upper limit of file size for imports appears to be de facto constrained by the file size limit set for PHP: You can't set the max file size higher than PHP is configured to support, and the max import size appears to be constrained by the max upload size.)

hillmark’s picture

This looks like a MAMP (1.8.3) related issue, as migrating the site to a production server fixes the problem. Any ideas as to what might be the cause?

hillmark’s picture

Status: Active » Fixed

Fixed!

I had changed the import path settings in example/admin/settings/imagefield_import

from: sites/default/files/images/import to: sites/default/files/images/upload

This broke things!

line 113 reads: '#default_value' => variable_get('imagefield_import_path', file_directory_path() .'/images/import'),

Does this mean that the module does not support a change of path without altering the module code?

jmpalomar’s picture

I got same issue. I copied images in a directory inside import directory and images didn't get imported but whe I moved images to root import directory everything worked again. ¿But I remember that previous versions allowed to put files inside directories, isn't it?.

wulff’s picture

#8: Yes, the module supports changing the import path without touching the code. The line of code you reference simply tries to set a sensible default value (in a standard install, this is sites/default/files/images/import).

wulff’s picture

#9: At the moment, the module only handles images in the selected import folder and ignores any subfolders. I'll take a look at adding support for recursive imports.

Status: Fixed » Closed (fixed)

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

donquixote’s picture

Title: 0 images imported. » 0 images imported, if images are in subfolder.
Category: support » bug
Status: Closed (fixed) » Active

Sorry, but the current behavior has to be considered a bug.
If you want to ignore subfolders, then please don't show these images on the list. Or mark them as "can not import". Or exclude them from the list, but show a message like "12 images were found in subfolders. These images can not be imported. Move them to the root folder if you want to import them".

The ideal way would be a folder navigation (so the list doesn't grow too big), but this would deserve a new issue.