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) »
  • Views 3 integration with multisite single database setup
Pages: [1]

Author Topic: Views 3 integration with multisite single database setup  (Read 847 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
Views 3 integration with multisite single database setup
March 28, 2012, 03:20:40 am
Hi

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 a couple of issues;

1. Registration Process - due to the need for members to be able to login to any site using the same username and password i have to point back to the main site contribution pages for registration which is a bit of a pain and confusing for the registrant...thought i'd mention it here as you may spot something in the code that would allow individual site registration...see my post http://forum.civicrm.org/index.php/topic,24044.0.html

2. Views 3 integration

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Views 3 integration with multisite single database setup

This forum was archived on 2017-11-26.