Allow specifying a global directory for user pictures ($100 bounty for D5)

alexanderpas - April 1, 2007 - 23:22
Project:Drupal
Version:7.x-dev
Component:user.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:multi-site, user pictures
Description

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)

#1

Boris Mann - April 1, 2007 - 23:51
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.

#2

Crell - April 2, 2007 - 00:33
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. :-)

#3

thepiano - May 10, 2008 - 15:59

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?

#4

alexanderpas - June 18, 2008 - 18:03
Version:6.x-dev» 7.x-dev
Priority:minor» normal

D6 is released, so putting this agains D7

#5

PeterKommer - July 2, 2008 - 04:10

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

#6

alexanderpas - September 13, 2008 - 11:03
Title:Multisite + Pictures - release of files directory restriction for pictures!» Multisite profile Picture Support broken.
Component:user system» profile.module
Category:feature request» bug report
Priority:normal» critical

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

#7

webchick - September 13, 2008 - 12:38
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.

#8

webchick - September 13, 2008 - 12:39
Title:Multisite profile Picture Support broken.» Allow specifying a global directory for user pictures

More apt title.

#9

Boris Mann - September 15, 2008 - 04:09
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.

#10

Crell - September 15, 2008 - 04:29

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

#11

alexanderpas - September 16, 2008 - 08:56
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.

#12

Flying Drupalist - October 11, 2008 - 04:30

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

#13

Dave Reid - October 11, 2008 - 08:11

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.

#14

alexanderpas - October 13, 2008 - 21:49

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?

#15

Dave Reid - October 13, 2008 - 21:52

I'll look into those.

#16

Flying Drupalist - November 19, 2008 - 14:24

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!

#17

alexanderpas - November 10, 2008 - 09:35
Title:Allow specifying a global directory for user pictures» [multisite] Allow specifying a global directory for user pictures

#18

Flying Drupalist - November 19, 2008 - 14:32

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.

#19

Dave Reid - November 19, 2008 - 17:36

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

#20

Gabriel Radic - December 12, 2008 - 12:41

[Lame SUBSCRIBE comment.]

#21

Gabriel Radic - December 12, 2008 - 14:39

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

#22

alexanderpas - December 12, 2008 - 17:55
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

#23

alexanderpas - December 14, 2008 - 18:24
Status:active» needs work

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

AttachmentSizeStatusTest resultOperations
multisite_picture_support.patch6.33 KBIgnoredNoneNone

#24

Dave Reid - January 20, 2009 - 04:04

#25

alexanderpas - February 8, 2009 - 00:59
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)
 
 

Drupal is a registered trademark of Dries Buytaert.