CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Multisite and Views 3
Pages: [1]

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

robbiemc

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 0
  • CiviCRM version: 4.5.0
  • CMS version: Drupal 7.22
  • MySQL version: 5.5.37
  • PHP version: 5.3.28
Multisite and Views 3
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

 

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Multisite and Views 3
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

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Multisite and Views 3

This forum was archived on 2017-11-26.