Author Topic: Multisite and Views 3  (Read 264 times)

Offline robbiemc

  • I’m new here
  • *
  • Posts: 27
  • Karma: 0
  • CiviCRM version: 4.2.6
  • CMS version: Drupal
  • MySQL version: 5.1.56
  • PHP version: 5.3.8
Multisite and Views 3
« on: May 31, 2012, 02:23:05 am »
Hi...apologies for posting this again but I am still having problems with Views 3 integration

Drupal 7
CiviCRM 4.1.beta3

I noted the topic http://forum.civicrm.org/index.php/topic,20910.30.html re views 3 integration but did not find a resolution to my error due to a slightly different setup.

I have a multisite (currently 5) single database setup with common login. The site has been setup following guidelines, can't remember where from, that gave instruction to change code in settings.php files for the main (default) and addon sites. This allows a single registration process and the member can then log in to any site with the same username and password although roles restrict what they are able to access outside their profile.

Unfortunately with this setup I have an issue trying to integrate Views 3;

Despite following the instructions for views 3 integration I get the following error code when trying to create a view with CiviCRM data;

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ehfap957_members.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 167 of /home/ehfap957/public_html/includes/lock.inc).

my main site settings.php file code is as follows;

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'ehfap957_members',
      'username' => 'myusername',
      'password' => 'mypassword',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => 'ehfa_',
    ),
  ),
);

and my subsite is as follows;

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'ehfap957_members',
      'username' => 'myusername',
      'password' => 'mypassword',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
    'prefix' => array(
    'default'   => 'fitcon_',
    'users'     => 'ehfa_',
    'sessions'  => 'ehfa_',
    'role'      => 'ehfa_',
    'authmap'   => 'ehfa_',
  ),
    ),
  ),
);

$databases['default']['default']['prefix']= array(
  'civicrm_acl'                              => '`ehfap957_civi`.',
  'civicrm_acl_cache'                        => '`ehfap957_civi`.',
  'civicrm_acl_contact_cache'                => '`ehfap957_civi`.',
etc etc


I have tried adding   'default' => '`fitcon_`.', and other variations but always seem to get an error code.

I also thought it might be that I am pulling data through the main site so I tried adding the database connector array to the main sites settings.php file but then when I try to set up a view in the addon site I get the following error;

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ehfap957_members.fitcon_civicrm_uf_match' doesn't exist


I am not a coder so any pointers on the correct code to allow me to create a Drupal View with CiviCRM data would be most appreciated.

Cheers

Robbie
YNWA

 

Offline Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 3586
  • Karma: 134
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly Drupal
Re: Multisite and Views 3
« Reply #1 on: May 31, 2012, 12:03:43 pm »
Do to your setup, the code beginning with:

Code: [Select]
$databases['default']['default']['prefix']= array(
is removing the previous prefix code.

Try this:

Code: [Select]
$databases['default']['default']['prefix']= array(

'default'   => 'fitcon_',
    'users'     => 'ehfa_',
    'sessions'  => 'ehfa_',
    'role'      => 'ehfa_',
    'authmap'   => 'ehfa_',

  'civicrm_acl'                              => '`ehfap957_civi`.',
  'civicrm_acl_cache'                        => '`ehfap957_civi`.',
  'civicrm_acl_contact_cache'                => '`ehfap957_civi`.',
etc etc

in place of what you have.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007