Drupal 7.41 CiviCRM: 4.6.9
Hi, new to CiviCRM and Drupal. Maybe I'm overlooking something but no matter what I try I cannot create a View from Drupal of any Civi data structure. For example, to show whether a logged in user is registered for a CiviEvent, I want to create a view of Civi_Participant but get the error:
Base table or view not found: 1146 Table 'drupal.civicrm_participant' doesn't exist
Check setting.php file (a snippet of which is below). Looks fine. Prefix is set to nothing but that shouldn't be a problem since default is properly set:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal',
'username' => 'dpal',
'password' => '*********',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
/** CiviCRM Views Integration
$databases['default']['default']['prefix']= array(
'default' => '',
'civicrm_acl' => 'civicrm
.',
'civicrm_acl_cache' => 'civicrm
.',
'civicrm_acl_contact_cache' => 'civicrm
.',
'civicrm_acl_entity_role' => 'civicrm
.',
Forgot to grant the drupal user SELECT access to the civicrm database? Don't think so. From mysql command line:
mysql> SHOW GRANTS for dpal@localhost;
Grants for dpal@localhost |
| GRANT ALL PRIVILEGES ON . TO 'dpal'@'localhost' IDENTIFIED BY PASSWORD
| GRANT SELECT ON
civicrm
.* TO 'dpal'@'localhost'
I tried another example where I tried to select civicrm_contact and selected the 'Show SQL' option for my view. I get:
SELECT civicrm_contact.id AS id
FROM
{civicrm_contact} civicrm_contact
LIMIT 10 OFFSET 0
I'm no SQL pro by any means but how does that query address the database civicrm? Where's the reference to the database? This is why I get the error:
Table 'drupal.civicrm_contact' doesn't exist
Views is defaulting to the Drupal database, not the civicrm database even when selecting Show CiviCRM Contact, or CiviCRM Participants or CiviCRM PrettyMuchAnythingElse. How do I fix that?
I tried a query from mysql directly and this works:
SELECT civicrm_contact.id AS id FROM civicrm.civicrm_contact;
How do I get drupal to do that? What are those kooky curly brackets. {civicrm_contact} .... Is that wrong?
Just in case you are wondering, yes, I am being driven crazy by this problem