Hello..
1) CCK 5.x-1.5
2) imagefield 5.x-2.x-dev
3) apache owned files dir, global tmp dir
4) public files
5) imagefield added to blog, multiple allowed, tokenized with "[uid]/blog-images" for path
6,7,8) Here is the situation. After configuring the imagefield with the path above, the first time the user starts a new node and uploads an image, the preview for that image is broken. This is because that path doesn't get created until their first submit (for tokenized paths).
It's actually sort of wierd, but drupal_create_path doesn't "create" any directories. :) So a call to imagefield_check_directory() is needed in _imagefield_widget_prepare_form(). I've included the patch I'm using for review.
Two other little side notes:
1) When setting up a new imagefield with tokenized paths, the module wants to create the directory no matter what. I see why it would do that for a non-tokenized path, but perhaps a check for '[]''s could be added so that a directory like '[uid]/blog-images' isn't literally created.
2) I submitted a patch for imagecatch that allows it to display images that are still in temp. (from imagefield, filefield and upload). It does so by just creating the derivative and sending it without saving a perminent copy. Assuming they accept it, I'd like to add the ability to imagefield to use a small derivative like that from imagecache in the add/edit form so that the original image isn't sent back to the creator. Is there interest in this for the project?
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | imagefield-token.patch | 1.22 KB | Moonshine |
| imagefield_5.patch | 1.13 KB | Moonshine |
Comments
Comment #1
Moonshine commentedAny chance of getting this commited? I have another patch waiting that uses imagecache for upload thumbs if it's installed...
Comment #2
Moonshine commentedI've also added another small patch that I think should find it's way in...
http://drupal.org/node/168059
Comment #3
mcvecka commentedIt appears that something went wrong when you generated the patch:
1. I can't see any change in the patch file except for different indentantion of a few lines
2. I can't see the function _imagefield_widget_prepare_form in the imagefield 5.x-2.x-dev. (Is there any later version of the imagefield.module than imagefield.module,v 1.30.2.6.2.22 2007/07/14 22:36:41 dopry Exp?)
Comment #4
Moonshine commentedSorry, looks like I just pached a little last second formating change there. You can take a look at this one instead. _imagefield_widget_prepare_form_values() is defined on line 471 in inside imagefield.module,v 1.30.2.6.2.22 2007/07/14 22:36:41 dopry.
Comment #5
dopry commentedcommitted to DRUPAL-5--2, thanks for the catch... I've been trying to avoid that imagefield_check_directory there for a long time.. I guess it just has to be. :)
Comment #6
wim leersThis is still not working properly, also not when you're not using tokens, but simply set your custom path.
Comment #7
dopry commentedActually previews were busted in general for imagefield and imagecache.. They should be fixed now.
Comment #8
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.