Drupal 6.4
Content Construction Kit (CCK) 6.x-2.0-rc7
FileField 6.x-3.0-alpha4
FileField Paths 6.x-1.x-dev (2008-Aug-29)
ImageCache 6.x-1.0-alpha2
ImageField 6.x-3.0-alpha2
Token 6.x-1.11
Transliteration 6.x-2.0
I use FileField Paths in combination with ImageField to rename uploaded files automatically.
At first I used [nid].[filefield_paths-ext].
The uploaded image was not visible after submitting the node. The CCK Block, which shows me the link to the uploaded image, showed the link with the original file name (not the renamed file name). After re-editing the node (without any edits, I just opened "Edit" and submitted immediately) the uploaded image was named correctly and the link to it, too.
I thought, this problem would relate to the use of [nid], so I tried some different tokens. But: I got this problem with each choice. I even tried
image.foobar, because there is nothing wich had to be "dynamically" created, but the image onlys shows up after edit or after I cleared the Drupal cache.
Help please.
Comments
Comment #1
no2e commentedPlease, can someone help me?
I can't go live in this state. If users upload images, noone can see them until I cleared the cache. And to cap it all it also shows the old (local) filename to the whole world, as long I cleared the cache. That's an absolute no-go. I don't want to let the world know how my users named their images.
Comment #2
deciphered@no2e
Unfortunately I'm currently on holidays and have a lot on my plate as I have just moved house. However as soon as I have everything settled I will look into this issue.
Comment #3
no2e commentedAh okay, that's understandable, of course.
Easy does it (or what you say in English ;D)
Comment #4
decipheredHi no2e,
As the node information is not available until a node has been created the file renaming is not done until you hit the 'Save' button.
This means that what you described in your initial post is the expected behavior, the user will upload the file, the file will be stored with it's original filename, the user will save the node and the file will be renamed.
What I don't understand is your second message, that the user can't see the files until you clear the cache. I can't replicate this issue myself, so if you could please elaborate and I will do my best to resolve this issue for you.
Cheers,
Deciphered.
Comment #5
no2e commentedSo, do you mean, that the image should be visible after submitting the node? Sorry, don't quite get it.
I state the way I create a new image node:
Procedure:
example.test(so there's no placeholder token used)img-element in the source code tries to load the image with it's original nameexample.test.thumb.jpg)example.test)Instead of re-editing the node (step 6) I could clear the Drupal cache. After that the image is visible, too.
And this behaviour is the same for whatever tokens I tried.
Comment #6
decipheredYes, the image should be showing, If you looked at the file system after you save the node the file should be renamed.
What are you using to display the image on the node? Is it being displayed via ImageCache or something similar?
Is your development server accessible?
Comment #7
no2e commentedYes, I have an ImageCache preset for the image shown in a node.
After submitting the node for the first time, the image URL of the source code shows the correct path for the ImageCache preset, but the wrong file name:
http://example.com/sites/default/files/imagecache/sshot_node/screenshots/screenshot-foobar.jpgThe server is not accessible.
Comment #8
decipheredIt's quite possible that the ImageCache preset is what's causing the problem. I will have to look into this a bit further.
Out of curiosity, can you check the actual uploaded file (/sites/default/files/screenshots/screenshot-foobar.jpg) to see if it changes correctly after one save? Just checking via ftp or directly on your server will do. I understand that the imagecache file is wrong, but it would be nice to know if the source image is correct.
Comment #9
decipheredConfirmed bug with ImageCache integration.
Comment #10
no2e commentedUhrm, it's weird.
I didn't see the uploaded image anywhere in my FTP account. I checked all subfolders of /default/files, but there was no currently uploaded image. So I cleared the Drupal cache. After that, I could see the image in Drupal itself under
http://example.com/sites/default/files/imagecache/sshot_node/screenshots/47.jpgbut in this folder at my FTP, there is no image named47.jpg. Weird. Even after logging out and in again, still: no image in FTP, but it's accessible in Drupal...But I can see the images which I uploaded before (e.g.
example.test), although I deleted the nodes.I test some more, now. Don't understand anything at the moment -.-
Comment #11
no2e commented(title overwritten)
Comment #12
no2e commentedDeciphered:
Are you trying to fix it, or is it an ImageCache issue?
Comment #13
decipheredYes, I am looking into fixing the issue.
I will post more when I have more, but the issue is not as simple as I first thought.
Comment #14
ipto commentedDeciphered Thank you for your very useful module
imagecache-6.x-2.0-beta1
imageapi-6.x-1.0
cck-6.x-2.0-rc10
filefield-6.x-3.0-alpha5
filefield_paths-6.x-1.x-dev
magefield-6.x-3.0-alpha2
Work fine, have't problem with filenames isung imagecache. But before (with other versions of plug-ins) was indeed a problem.
Comment #15
no2e commentedIt works for me, too.
Just updated the modules to the same versions as ipto did. I uploaded an image and I can see imagecache and original versions immediately.
Comment #16
decipheredThanks for the update guys, I can confirm that the latest version of ImageCache has fixed this issue.