0

I have an unusual problem that doesn't appear to have a workable solution....

We have a multi-site setup that has a shared database for taxonomy and the users tables and it's related tables.

Each site then has it's own core database with content, permissions and file_managed.

We would like to keep the file managed table unique to each site, as the amount of images and video's expected will be significant over time.

This leaves us with one small issue in that the "picture" field in the user table is referring to a FID from the file_managed table. If I set my profile picture when on site 1, it works great. If I visit site 2, the same user table will return a FID from that site, which could and usually would be a completely different picture.

Has anyone had any experience in getting around this situation? We don't want to go down separate users for each site, and we don't want to have one file table for all sites.

Ideally I'd like to be able to hard code a url for the "picture" field in the user table, but I'm not sure if this is possible?

Any help is very much appreciated.

1

What I would do is:

  1. Use hook_form_alter to add non-managed file upload to profile edit page.
  2. Configure Drupal or webserver so that directory for these files was common, or so that all pictures would get uploaded to the "main" site's folder.
  3. To a profile, I would add a link field. Configure it to be shared between sites, too.
  4. In a submit handler (again, added using hook_form_alter) I would populate this field with the URL to uploaded image.
  • So does the link field you refer to in step 3, link the picture dynamically to whatever is in the new non managed field we've created – BeardedGeek Nov 11 '13 at 14:48
  • @BeardedGeek I'm not sure I understand your comment, but if I do then yes, that's the idea. – Mołot Nov 11 '13 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.