Currently the directory where you can store userpictures is restricted to a map within the directory you've selected for your files
(user_picture_path must reside within file_directory_path)
However, if you're working on a multisite, with a shared database and shared tables for the usernames, seperate settings for file_directory_temp and file_directory_path it is NOT POSSIBLE to have a common pictures directory, thus severely limiting multisite possibilities.
My request is to release the restriction for the user_picture_path, and make the variable in a similar way as done with the file_directory_path (sites/domain/files) and the file_directory_temp (sites/domain/tmp) variable so we can have for example sites/all/pictures (or something else) set for user_picture_path
(user_picture_path side-to-side with file_directory_path)
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | multisite_picture_support.patch | 6.33 KB | alexanderpas |
Comments
Comment #1
boris mann commentedYou can set the filepath for all your sites to the same thing and then the pictures will be all in one place. Or, you could symlink at the filesystem layer so that it's all the same folder.
I'm setting this to "by design" -- feel free to upload a patch, though.
Comment #2
Crell commentedActually no, Drupal actively prevents you from symlinking out of the files directory. I spent several hours trying to figure out why the fancy file stuff I was doing didn't work before realizing that. :-( I'm sure the reason is "for security", but it's still damned annoying. Hard links could work; I've not tried them.
Drupal's file handling in general needs a lot of love. Unfortunately, I am not familiar enough with it to give it the love it needs.
This should also be against D6. :-)
Comment #3
ThePiano.SG commentedI'm in this situation now, and I can't find a way out to allow users to share avatar across multi-sites.
User who uploads avatar in site1 can only see it in site1, and in site2, the URL to the picture is incorrect.
Is there anyway out of this sticky situation?
Comment #4
alexanderpas commentedD6 is released, so putting this agains D7
Comment #5
PeterKommer commentedThere's a few posts related to this issue ; I've found one at : http://drupal.org/node/254870
I'm a newbie at drupal, but maybe this issue can get lumped into one thread.
Regards, Pete
Comment #6
alexanderpas commentedputting this as critical bug, against the profile module (where it should've been always), as it breaks core functionality!
Comment #7
webchicka) This isn't critical. Using multisite at all qualifies as an edge case. But it would be nice to see this fixed.
b) It's actually user.module that exposes the picture functionality, not profile module.
Comment #8
webchickMore apt title.
Comment #9
boris mann commentedThis could be "fixed" by using symlinks. Or by a module that implemented a global directory as you describe, optimized for multisite usage (i.e. don't use user module).
Feels like an edge case.
Comment #10
Crell commentedBoris: See comment #10. Drupal actively prevents you from using symlinks inside the files directory. I already wasted several hours of my life figuring that out a while back. :-)
Comment #11
alexanderpas commentedputting back to normal, as #9 is not working, due to a drupal feature (see #2 and#10).
also, we shoudn't be fixing a core bug with a new module.
Comment #12
Flying Drupalist commentedWould be nice if there was a module in the meantime.
Comment #13
dave reidActually, I just made a symbolic link between two different site's pictures directories and it worked just fine.
http://davenjenny.com/sites/davenjenny.com/files/pictures/picture-1.jpg = http://davereid.net/sites/davereid.net/files/pictures/picture-1.jpg
Same image only one location.
If you're interested in checking, there's also a picture-3.jpg, picture-4.jpg, and picture-10.jpg.
Comment #14
alexanderpas commentedit seems you set the symlink after making your settings....
- did you try saving/changing the picture directory setting, after the change?
- were you able to obtain the images from a second (multi)site?
- did you try uploading a new picture?
Comment #15
dave reidI'll look into those.
Comment #16
Flying Drupalist commentedIt still would be nice, and is more sensible, to have the picture folder be in all/, so we don't have to symlink every folder!
Comment #17
alexanderpas commentedComment #18
Flying Drupalist commentedDave Reid, the only reason why your symlink worked is because you did it incorrectly. You linked from your global directory to your subsite, which works fine if you're doing it for only ONE site, adding additional sites would not work. The idea is to symlink from the subsites to the global directory, which I can confirm Crell's statement, does not work.
Comment #19
dave reidI was hopeful, but wrong. I'll do some investigating on the code-side and see how it can be fixed.
Comment #20
Gabriel R. commented[Lame SUBSCRIBE comment.]
Comment #21
Gabriel R. commented100$ for a quick fix for Drupal 5, see here http://groups.drupal.org/node/14852#comment-59820
Comment #22
alexanderpas commentedas per #21
Comment #23
alexanderpas commentedOkay, I've made a first stab at it for D7, anyone willing can pick it up from here.
Comment #24
dave reidComment #25
alexanderpas commentedComment #26
Fidelix commentedThis is getting old...
Subscribing...
Comment #27
sunObsoleted by #1292470: Convert user pictures to Image Field