Imagefield_import has problems with the filefield_path and token modules
ivanjaros - January 4, 2009 - 15:38
| Project: | Imagefield Import |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | fixed |
Description
When I import images with imagefield import, it doesn't place them into proper folders. First I've imported a few images and it placed them into my tmp directory. Second time, I've imported only one image and it placed it into first folder from my path(1/2/3/, it placed it only into /1/). I assume that there is some bug with path loading.

#1
Sorry Ivan, I'm not following...
You did to consecutive imports, and the images ended up in different directories?
#2
I have set path for my cck imagefiled to "img/galeria/[termpath-raw]" = 3+ folders. As I wrote, first time it "imported" images into tmp folder, second time(1 pic) to the "img" folder, but it should import them into "img/galeria/sterm1/term2/term3/".
#3
I have the same problem:
1. Enable imagefield, filefield_paths and tokens (perhaps even pathauto?)
2. Use tokens in the supplied fields from filefield_paths, for example date.
3. Import images into nodes.
4. Notice how you will find a directory in your files directory called the path you entered in #2, and with the TOKEN in place somewhere in the directory hierarchy or file name.
5. Edit the node.
6. Voilá the file is in its correct place. No data is lost.
I imported about 70 pictures yesterday storing them in a directory structure where I change the name of the images to the same name as the node gets, and it performed as above. Since IMAGEFIELD_IMPORT, doesn't set any language data when available, I had to edit every picture anyway, so no biggie for me, but a gotcha for unwary users.
#4
This problem might be because imagefield_import doesn't try to create a new directory first. The attached patch works for me.
#5
I forget to use the unified diff style - here's the patch using that.
#6
Thanks for the patch. This should be committed.
#7
I don't understand why this patch is needed. After fixing #591494: Image file tokens are ignored, now Imagefield_import puts image files into the right directory. But when I tried the patch attached above, it only creates unnecessary temporary directories like "files/[termpath]". So without the patch above and with the patch from #591494: Image file tokens are ignored Imagefield_import works correctly for me.
#8
I am reporting the same problem.
I am using latest version of imagefield, imagefield import e filefield paths and token.
In my case I am not using token in the path of my CCK imagefield. The path is just:
/images/
relative to sites/default/files
When I upload through imagefiled import, my images don't go to the right folder, but just in the drupal's filesystem root.
No difference if I use the suggested patch.
Thank you.
GP
#9
Please specify what a patch did you try?
#10
@Jurta
I have tried patch at comment #5 of this thread!
Ciao,
GP
#11
this one (#5 above) solved my problem, i think it would help a lot to commit it. thanks !
#12
A fix similar to the patch in #5 has been added to the latest dev version of the module. (See the imagefield_import_batch_import() function.)