global_avatar_create_url() appears to support private downloads, but I can't see how it would be possible.

When system/files/ is in the path, file_download() is called, which calls file_create_path(), which calls file_check_location() against the site's file system path, not the global avatar path. file_check_location() will return false in this case, giving you a 404 error instead of an image.

The workaround I used was to copy global_avatar_preprocess_user_picture() to my theme and remove "system/files" from the avatar url there.

It seems like the options to fix this would be limited to disallowing private downloads for avatars or else to include a replacement for file_download() like you did with file_create_url().

Please let me know if I'm missing some obvious thing that will make this problem go away. :)

Comments

cpliakas’s picture

Issue tags: +6.x-1.1

melvix,

Thanks for the bug report and the information. I honestly haven't done very much testing with private files, so I would not be surprised if there was an issue here. Marking for the 6.x-1.1 release.

Thanks for all the info,
Chris

patrick.thurmond@gmail.com’s picture

I am seeing this issue as well with another module and I think the solution is to use file_create_url() to generate a useable URL for the file. I am still in the process of testing, but its a start.

patrick.thurmond@gmail.com’s picture

Hey guys, I was able to fix this with a patch in the Avatar Crop module. You can find it here: http://drupal.org/node/598684

Take a look and see if that will work here for you. Good luck!