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)

CommentFileSizeAuthor
#23 multisite_picture_support.patch6.33 KBalexanderpas

Comments

boris mann’s picture

Priority: Critical » Minor

You 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.

Crell’s picture

Version: 5.1 » 6.x-dev

Actually 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. :-)

ThePiano.SG’s picture

I'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?

alexanderpas’s picture

Version: 6.x-dev » 7.x-dev
Priority: Minor » Normal

D6 is released, so putting this agains D7

PeterKommer’s picture

There'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

alexanderpas’s picture

Title: Multisite + Pictures - release of files directory restriction for pictures! » Multisite profile Picture Support broken.
Component: user system » profile.module
Category: feature » bug
Priority: Normal » Critical

putting this as critical bug, against the profile module (where it should've been always), as it breaks core functionality!

webchick’s picture

Component: profile.module » user.module
Priority: Critical » Normal

a) 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.

webchick’s picture

Title: Multisite profile Picture Support broken. » Allow specifying a global directory for user pictures

More apt title.

boris mann’s picture

Priority: Normal » Minor

This 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.

Crell’s picture

Boris: 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. :-)

alexanderpas’s picture

Priority: Minor » Normal

putting 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.

Flying Drupalist’s picture

Would be nice if there was a module in the meantime.

dave reid’s picture

Actually, I just made a symbolic link between two different site's pictures directories and it worked just fine.

cd ~/drupal-6/sites/davereid.net/files
ln -s ~/drupal-6/sites/davenjenny.com/files/pictures .

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.

alexanderpas’s picture

it 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?

dave reid’s picture

I'll look into those.

Flying Drupalist’s picture

Title: [multisite] Allow specifying a global directory for user pictures » Allow specifying a global directory for user pictures

It 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!

alexanderpas’s picture

Title: Allow specifying a global directory for user pictures » [multisite] Allow specifying a global directory for user pictures
Flying Drupalist’s picture

Title: Allow specifying a global directory for user pictures » [multisite] Allow specifying a global directory for user pictures

Dave 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.

dave reid’s picture

I was hopeful, but wrong. I'll do some investigating on the code-side and see how it can be fixed.

Gabriel R.’s picture

[Lame SUBSCRIBE comment.]

Gabriel R.’s picture

100$ for a quick fix for Drupal 5, see here http://groups.drupal.org/node/14852#comment-59820

alexanderpas’s picture

Title: [multisite] Allow specifying a global directory for user pictures » [multisite] Allow specifying a global directory for user pictures ($100 bounty for D5)

as per #21

alexanderpas’s picture

Status: Active » Needs work
StatusFileSize
new6.33 KB

Okay, I've made a first stab at it for D7, anyone willing can pick it up from here.

dave reid’s picture

Issue tags: +multi-site, +user pictures
alexanderpas’s picture

Title: [multisite] Allow specifying a global directory for user pictures ($100 bounty for D5) » Allow specifying a global directory for user pictures ($100 bounty for D5)
Fidelix’s picture

This is getting old...
Subscribing...

sun’s picture

Status: Needs work » Closed (won't fix)
Issue tags: -multi-site, -user pictures