Closed (fixed)
Project:
ImageField
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Apr 2008 at 19:43 UTC
Updated:
14 Feb 2009 at 01:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
dopry commented@michaelfavia, that would be awesome.. I committed some fixes to it already... to use imagefield_check_directory instead of file_check_directory.
Comment #2
dopry commentedbumping version to dev.
Comment #3
ckngVer 2.1 & 2.x-dev that uses imagefield_check_directory still has the same problem.
The folder 'imagefield_default_images' has to be manually created.
Also the 'imagefield_default_images' feature seems to break default image for multiple instances of same imagefield as in {node_field_instance}. The default image becomes the same for all instances. Used to work under 2.0-x.
Comment #4
keesje commentedNot sure this is related to the same issue.
In preview modus (edit node) image is not shown, it points to /files/path...
The actual image is stored in /path... outside the files path.
All modules are latest version (2.x branche).
This is probably due to content type importing (cck) from a content type export generated from an older module (1.x branche).
Resubmitting the image fields resolves the problem.
Comment #5
johnalbinThe problem is this bit of code:
file_create_path() checks to see that "imagefield_default_images" is a valid directory in the default files directory. Since the directory has yet to be created, it is NOT, so it returns false. dirname(FALSE) returns "." and imagefield_check_directory(".") returns TRUE. So the code doesn't create the directory and, worse, $dst is set to FALSE.
$dst = 'imagefield_default_images/'. $filename;should fix it.Also, the
unlink($field['default_image']['filepath']);just below that does nothing (except generate a warning) since $field['default_image']['filepath'] is a relative path and unlink() requires a full path.Comment #6
johnalbinReview, of course!
Comment #7
pimok3000 commentedThis patch works like a charm , thank you !
Comment #8
johnalbinTaking the liberty to RTBC based on previous comment.
Comment #9
neclimdulwfm as well. fixed an associated problem where I was getting really old expire headers on the default image. through imagecache.
Comment #10
drewish commentedthanks, committed to DRUPAL-5--2
Comment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #12
gvanhoof commentedhi john,
i got the following : warning: unlink() [function.unlink]: No such file or directory in /var/www/drupal5/modules/imagefield/imagefield.module on line 177 when setting default image.
i am not sure whether your patch would fix it. if so, how do I install the patch on my server? sorry for the dum question but i am new to drupal and the installation was done by somebody else.
thanks, greg
Comment #13
mtraherne commentedI'm got the same error. After I received the error I was unable to upload any files.
Any solution on this?
Comment #14
ekrispin commentedThe patch doesn't work for us.
The directory now indeed is created but the default photo does not show when viewing a cck content without any photo uploaded for this field.
Comment #15
johnalbinYou don't need the patch. The fix has already been included in imagefield.