Needs review
Project:
ImageCache
Version:
6.x-2.0-rc1
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jun 2011 at 06:55 UTC
Updated:
2 May 2013 at 19:29 UTC
Hi, I'm after a bit of help. I've created 2 presets, but the folders aren't actually being created in the file system and images will be upload to /sites/default/files/imagefield_thumbs. The images I upload are being placed in the /sites/default/files folder , but when I try and view the file directly I get a 404 not found.
clean URLs+ file system is public.
The permissions are ok, uploads are possible.
.htaccess have
ewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
and
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options +FollowSymlinks
Does anyone know what the problem might be?
Thanks in advance.
Comments
Comment #1
develcuy commentedI'm using the following patched imagecache_create_url function:
Comment #2
jrsinclair commentedI had the same issue. Patched imagecache_create_url() function fixed the issue for me, although I don't know if this is really the best approach. But thank you develCuy for finding at least some solution.
Comment #3
Josias commentedIt worked for me!
Thanks.
Comment #4
sandrewj commentedFor anyone using this patch:
Please verify:
Apache serves the image files in your files directory (including in imagecache)
This patch seems to be a work-around for the public file system callback not be triggered when requesting a image that is not yet generated.
If this patch works for you, I believe it would be better to generate the image in the imagecach_create_url function and still return the nice looking url.
imagecache_generate_image only generates the image if it does not exist.
Comment #5
sandrewj commentedA little bit better option for the end of the function. The if statement checks that the file system is public and clean urls are disabled.
Comment #6
develcuy commentedThank you @sandrewj, I have tested your version and worked fine, having the nice url is great for SEO!
Just removed variable $rs which is not needed:
Comment #7
sandrewj commentedComment #8
jadowd commentedThis still doesn't work for me. I have memcache installed, and am using nginx over everything else... thoughts?
Comment #9
sandrewj commentedAre you using the patch in #6? Do you have clean urls disabled? Is your file system public?
If you answered no to any of those questions you can try the patch in #4, which will generate the image even on a private filesystem or with clean urls enabled.
Comment #10
zonezen commentedThank you @sandrewj.
Comment #11
jadowd commentedStill working with rc1, I just want to make sure that the changes outlined in this thread, specifically the addition of the following code:
-------------------------------------8<-------------------------------------
if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC && variable_get('clean_url', '0')){
imagecache_generate_image($presetname, $filepath);
}
------------------------------------->8-------------------------------------
has been added to the source for this module? I seem to have recalled having this fixed, but somewhere along the way, I must have done an upgrade, but the problem returned. It would be nice not to have to apply this hack over and over again across the many sites that I maintain.
thanks,
Comment #12
jadowd commentedyeah, I'm doing updates today, and the fix is not in the mix. Can you re-apply the patch to the code base, and push it out in a release candidate 3 iteration of the module?
Comment #13
mattwmc commentedThank you Lord for this!
I've been trying to figure this out for days.
Appears to be a Linux issue: clean urls off and file set to private makes imagecache work.
Now this patch works with clean urls on and files set to public on linux.
I found this through here: https://www.redfoxhosting.com/forums/threads/5720-RESOLVED-Drupal-Uberca...
Which made me google clean urls off and imagecache.
This should really be added to the list of things and fixes to check when trying to figure out why imagecache isn't working.
Note: I used the patch in #6.
#4 gave me some kind of T variable error or whatever.
Comment #14
jerry commentedSetting this back to active, as I encountered the problem myself today and the fix does not appear to be in the current dev release.
Comment #15
roball commentedTry the following content in the
.htaccessfile residing in thesites/example.com/filesdirectory that serves as the public file system path for the sitewww.example.com: