Scenario:
I've developed a module where a multisite-administrator can add some text and photos that are available on all sites throughout the system.

Problem:
I need the image info stored in a shared file table (eg, shared.file_managed). All the regular images (not pulled from module) should still live in a site.file_managed table.

Anyone have any documention, tips, or references how to achieve this? Is it possible to change the table_prefix for only certain modules/functions? Or am I going to have to clone file.inc and modify it?

Thanks!

Comments

jaypan’s picture

You can find out more about how to do it (and the risks involved) here: http://drupal.org/node/22267

Contact me to contract me for D7 -> D10/11 migrations.

ldsnerd’s picture

I know about using shared tables (am using it in other places). BUT, i want the table ONLY to be shared when using this module. EG, I want individual file uploads to go to individual DB tables. I want files uploaded through this module (only) to be in a shared table. So the only way a user could access this shared file table would be through the module...otherwise it would always use the non-shared file table.

jaypan’s picture

I think you'll have to work out your own custom solution for this. Drupal allows for the sharing of entire tables, but not rows of tables. Maybe when a file is uploaded, you can ping the other site and get it to add an instance of that file to the database.

Contact me to contract me for D7 -> D10/11 migrations.