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

vordude - January 7, 2009 - 05:51

Sorry Ivan, I'm not following...

You did to consecutive imports, and the images ended up in different directories?

#2

ivanjaros - January 7, 2009 - 20:45

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

pkej - January 19, 2009 - 14:56
Title:Doesn't upload into desired filepath» Imagefield_import has problems with the filefield_path and token modules

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

danieljames - June 2, 2009 - 14:55

This problem might be because imagefield_import doesn't try to create a new directory first. The attached patch works for me.

AttachmentSize
imagefield_import.patch 428 bytes

#5

danieljames - June 2, 2009 - 15:00

I forget to use the unified diff style - here's the patch using that.

AttachmentSize
imagefield_import.patch 963 bytes

#6

sgriffin - June 7, 2009 - 19:52

Thanks for the patch. This should be committed.

#7

jurta - September 29, 2009 - 22:00

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

gp.mazzola - October 12, 2009 - 15:54

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

jurta - October 12, 2009 - 18:43

Please specify what a patch did you try?

#10

gp.mazzola - October 12, 2009 - 22:17

@Jurta

I have tried patch at comment #5 of this thread!

Ciao,
GP

#11

mojzis - October 22, 2009 - 10:28
Status:active» reviewed & tested by the community

this one (#5 above) solved my problem, i think it would help a lot to commit it. thanks !

#12

wulff - November 21, 2009 - 11:34
Version:6.x-1.3-beta1» 6.x-1.x-dev
Status:reviewed & tested by the community» fixed

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.)

 
 

Drupal is a registered trademark of Dries Buytaert.