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
Pages: 1 [2] 3

Author Topic: Views 3 integration  (Read 9422 times)

tonthon

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
    • Majerti is specialized in OpenSource technologies
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: it depends
  • PHP version: it depends
Re: Views 3 integration
August 18, 2011, 04:44:18 am
If you read the drupal 7 setting file :
<pre>
* You can also use a reference to a schema/database as a prefix. This maybe
 * useful if your Drupal installation exists in a schema that is not the default
 * or you want to access several databases from the same code base at the same
 * time.
 * Example:
 * @code
 *   'prefix' => array(
 *     'default'   => 'main.',
 *     'users'     => 'shared.',
 *     'sessions'  => 'shared.',
 *     'role'      => 'shared.',
 *     'authmap'   => 'shared.',
 *   );
</pre>
So the solution for you, add the :

$databases['default']['default']['prefix'] = array(
'default'   => 'd7';
'civicrm......
);


Gaston TJEBBES
Majerti
g.t [at] majerti.fr
http://www.majerti.fr
Audit/Conseil IT, Développement, Formation
+33 (0)6 32 70 70 00

jdaniluk

  • I’m new here
  • *
  • Posts: 20
  • Karma: 0
  • CiviCRM version: 4.2.0
  • CMS version: Drupal 7.14
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Views 3 integration
August 18, 2011, 08:10:16 am
Quote from: tonthon on August 18, 2011, 04:44:18 am
So the solution for you, add the :

$databases['default']['default']['prefix'] = array(
'default'   => 'd7';
'civicrm......
);

Tonthon's solution works!  (Except that's a comma, not a semicolon, after the added line.)

My site appears to be working fine, and Views lets me see the Civi objects and fields.  Now to restore all my modules and my theme...

I was seriously considering removing the prefix from all the Drupal tables.  (I don't really need it, it just seemed like a good idea at the time.)  That would probably have worked, but this is quicker.

To summarize, here's my new settings.php code:
Quote
$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'ntrlst2_ntrls',
      'username' => 'myuser',
      'password' => 'mypass',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => 'd7',
    ),
  ),
);

$databases['default']['default']['prefix']= array(
  'default'                                    => 'd7',
  'civicrm_acl'                              => '`ntrlst2_civi`.',
  'civicrm_acl_cache'                        => '`ntrlst2_civi`.',
...
 'civicrm_website'                          => '`ntrlst2_civi`.',
  'civicrm_worldregion'                      => '`ntrlst2_civi`.',
);


Thanks for everybody's help!

cognoscento

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Views 3 integration
September 18, 2011, 07:58:02 pm
Quote from: Donald Lobo on August 11, 2011, 08:05:44 pm

If drupal and civicrm are in the same database, then you dont need to add anything to the db_prefix array..

Hence the views integration settings does not show up for you

That makes sense, but then I don't understand why it's looking for "interpdrupalcivi2.drupal_civicrm_membership" when it should be looking for "interpdrupalcivi2.civicrm_membership". Is there something wrong with this?

Code: [Select]
$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'interpdrupalcivi2',
      'username' => '**username**',
      'password' => '**pasword**',
      'host' => 'mysql.***.ca',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => 'drupal_',
    ),
  ),
);

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Views 3 integration
September 19, 2011, 03:26:03 am
What does your Drupal Integration Settings page show? It should have code like:

Code: [Select]
$databases['default']['default']['prefix']= array(
  'civicrm_acl'                              => '`civicrm_`.',
  'civicrm_acl_cache'                        => '`civicrm_`.',
...

there. You need to add that to your settings.php file.
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.

cognoscento

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Views 3 integration
September 19, 2011, 07:20:56 am
Hershel--

There's nothing but a field asking where my Drupal users table is; no prefix array at all. Earlier in the thread, I was told that meant I had the right settings, but I clearly don't...

C.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Views 3 integration
September 19, 2011, 07:25:44 am
try adding this and see what happens:

Code: [Select]
$databases['default']['default']['prefix']= array(
  'civicrm_acl'                              => '`civicrm_`',
  'civicrm_acl_cache'                        => '`civicrm_`',
  'civicrm_acl_contact_cache'                => '`civicrm_`',
  'civicrm_acl_entity_role'                  => '`civicrm_`',
  'civicrm_action_log'                       => '`civicrm_`',
  'civicrm_action_mapping'                   => '`civicrm_`',
  'civicrm_action_schedule'                  => '`civicrm_`',
  'civicrm_activity'                         => '`civicrm_`',
  'civicrm_activity_assignment'              => '`civicrm_`',
  'civicrm_activity_target'                  => '`civicrm_`',
  'civicrm_address'                          => '`civicrm_`',
  'civicrm_address_format'                   => '`civicrm_`',
  'civicrm_batch'                            => '`civicrm_`',
  'civicrm_cache'                            => '`civicrm_`',
  'civicrm_campaign'                         => '`civicrm_`',
  'civicrm_campaign_group'                   => '`civicrm_`',
  'civicrm_case'                             => '`civicrm_`',
  'civicrm_case_activity'                    => '`civicrm_`',
  'civicrm_case_contact'                     => '`civicrm_`',
  'civicrm_component'                        => '`civicrm_`',
  'civicrm_contact'                          => '`civicrm_`',
  'civicrm_contact_type'                     => '`civicrm_`',
  'civicrm_contribution'                     => '`civicrm_`',
  'civicrm_contribution_page'                => '`civicrm_`',
  'civicrm_contribution_product'             => '`civicrm_`',
  'civicrm_contribution_recur'               => '`civicrm_`',
  'civicrm_contribution_soft'                => '`civicrm_`',
  'civicrm_contribution_type'                => '`civicrm_`',
  'civicrm_contribution_widget'              => '`civicrm_`',
  'civicrm_country'                          => '`civicrm_`',
  'civicrm_county'                           => '`civicrm_`',
  'civicrm_currency'                         => '`civicrm_`',
  'civicrm_custom_field'                     => '`civicrm_`',
  'civicrm_custom_group'                     => '`civicrm_`',
  'civicrm_dashboard'                        => '`civicrm_`',
  'civicrm_dashboard_contact'                => '`civicrm_`',
  'civicrm_dedupe_exception'                 => '`civicrm_`',
  'civicrm_dedupe_rule'                      => '`civicrm_`',
  'civicrm_dedupe_rule_group'                => '`civicrm_`',
  'civicrm_discount'                         => '`civicrm_`',
  'civicrm_domain'                           => '`civicrm_`',
  'civicrm_email'                            => '`civicrm_`',
  'civicrm_entity_batch'                     => '`civicrm_`',
  'civicrm_entity_file'                      => '`civicrm_`',
  'civicrm_entity_financial_trxn'            => '`civicrm_`',
  'civicrm_entity_tag'                       => '`civicrm_`',
  'civicrm_event'                            => '`civicrm_`',
  'civicrm_file'                             => '`civicrm_`',
  'civicrm_financial_account'                => '`civicrm_`',
  'civicrm_financial_trxn'                   => '`civicrm_`',
  'civicrm_grant'                            => '`civicrm_`',
  'civicrm_group'                            => '`civicrm_`',
  'civicrm_group_contact'                    => '`civicrm_`',
  'civicrm_group_contact_cache'              => '`civicrm_`',
  'civicrm_group_nesting'                    => '`civicrm_`',
  'civicrm_group_organization'               => '`civicrm_`',
  'civicrm_im'                               => '`civicrm_`',
  'civicrm_line_item'                        => '`civicrm_`',
  'civicrm_loc_block'                        => '`civicrm_`',
  'civicrm_location_type'                    => '`civicrm_`',
  'civicrm_log'                              => '`civicrm_`',
  'civicrm_mail_settings'                    => '`civicrm_`',
  'civicrm_mailing'                          => '`civicrm_`',
  'civicrm_mailing_bounce_pattern'           => '`civicrm_`',
  'civicrm_mailing_bounce_type'              => '`civicrm_`',
  'civicrm_mailing_component'                => '`civicrm_`',
  'civicrm_mailing_event_bounce'             => '`civicrm_`',
  'civicrm_mailing_event_confirm'            => '`civicrm_`',
  'civicrm_mailing_event_delivered'          => '`civicrm_`',
  'civicrm_mailing_event_forward'            => '`civicrm_`',
  'civicrm_mailing_event_opened'             => '`civicrm_`',
  'civicrm_mailing_event_queue'              => '`civicrm_`',
  'civicrm_mailing_event_reply'              => '`civicrm_`',
  'civicrm_mailing_event_subscribe'          => '`civicrm_`',
  'civicrm_mailing_event_trackable_url_open' => '`civicrm_`',
  'civicrm_mailing_event_unsubscribe'        => '`civicrm_`',
  'civicrm_mailing_group'                    => '`civicrm_`',
  'civicrm_mailing_job'                      => '`civicrm_`',
  'civicrm_mailing_recipients'               => '`civicrm_`',
  'civicrm_mailing_spool'                    => '`civicrm_`',
  'civicrm_mailing_trackable_url'            => '`civicrm_`',
  'civicrm_mapping'                          => '`civicrm_`',
  'civicrm_mapping_field'                    => '`civicrm_`',
  'civicrm_membership'                       => '`civicrm_`',
  'civicrm_membership_block'                 => '`civicrm_`',
  'civicrm_membership_log'                   => '`civicrm_`',
  'civicrm_membership_payment'               => '`civicrm_`',
  'civicrm_membership_status'                => '`civicrm_`',
  'civicrm_membership_type'                  => '`civicrm_`',
  'civicrm_menu'                             => '`civicrm_`',
  'civicrm_navigation'                       => '`civicrm_`',
  'civicrm_note'                             => '`civicrm_`',
  'civicrm_openid'                           => '`civicrm_`',
  'civicrm_option_group'                     => '`civicrm_`',
  'civicrm_option_value'                     => '`civicrm_`',
  'civicrm_participant'                      => '`civicrm_`',
  'civicrm_participant_payment'              => '`civicrm_`',
  'civicrm_participant_status_type'          => '`civicrm_`',
  'civicrm_payment_processor'                => '`civicrm_`',
  'civicrm_payment_processor_type'           => '`civicrm_`',
  'civicrm_pcp'                              => '`civicrm_`',
  'civicrm_pcp_block'                        => '`civicrm_`',
  'civicrm_persistent'                       => '`civicrm_`',
  'civicrm_phone'                            => '`civicrm_`',
  'civicrm_pledge'                           => '`civicrm_`',
  'civicrm_pledge_block'                     => '`civicrm_`',
  'civicrm_pledge_payment'                   => '`civicrm_`',
  'civicrm_preferences'                      => '`civicrm_`',
  'civicrm_preferences_date'                 => '`civicrm_`',
  'civicrm_premiums'                         => '`civicrm_`',
  'civicrm_premiums_product'                 => '`civicrm_`',
  'civicrm_prevnext_cache'                   => '`civicrm_`',
  'civicrm_price_field'                      => '`civicrm_`',
  'civicrm_price_field_value'                => '`civicrm_`',
  'civicrm_price_set'                        => '`civicrm_`',
  'civicrm_price_set_entity'                 => '`civicrm_`',
  'civicrm_product'                          => '`civicrm_`',
  'civicrm_project'                          => '`civicrm_`',
  'civicrm_relationship'                     => '`civicrm_`',
  'civicrm_relationship_type'                => '`civicrm_`',
  'civicrm_report_instance'                  => '`civicrm_`',
  'civicrm_saved_search'                     => '`civicrm_`',
  'civicrm_state_province'                   => '`civicrm_`',
  'civicrm_subscription_history'             => '`civicrm_`',
  'civicrm_survey'                           => '`civicrm_`',
  'civicrm_tag'                              => '`civicrm_`',
  'civicrm_task'                             => '`civicrm_`',
  'civicrm_task_status'                      => '`civicrm_`',
  'civicrm_tell_friend'                      => '`civicrm_`',
  'civicrm_timezone'                         => '`civicrm_`',
  'civicrm_uf_field'                         => '`civicrm_`',
  'civicrm_uf_group'                         => '`civicrm_`',
  'civicrm_uf_join'                          => '`civicrm_`',
  'civicrm_uf_match'                         => '`civicrm_`',
  'civicrm_website'                          => '`civicrm_`',
  'civicrm_worldregion'                      => '`civicrm_`',
);
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.

cognoscento

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Views 3 integration
September 19, 2011, 08:48:28 pm
When I add it, the whole site throws the following error. When I remove it, it goes back to normal.

Code: [Select]
Error
The website encountered an unexpected error. Please try again later.
Error message
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'interpdrupalcivi2.semaphore' doesn't exist: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] => variable_init ) in lock_may_be_available() (line 164 of /home/interp5/interpscan.ca/includes/lock.inc).
Uncaught exception thrown in shutdown function.

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table &#039;interpdrupalcivi2.semaphore&#039; doesn&#039;t exist: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] =&gt; 21061421754e780cbf1c8843.88200993 ) in lock_release_all() (line 266 of /home/interp5/interpscan.ca/includes/lock.inc).

What next?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Views 3 integration
September 20, 2011, 02:23:41 am
My mistake. Use this:

Code: [Select]
$databases['default']['default']['prefix']= array(
  'default'                                    => 'drupal_',
  'civicrm_acl'                              => '`civicrm_`',
  'civicrm_acl_cache'                        => '`civicrm_`',
  'civicrm_acl_contact_cache'                => '`civicrm_`',
  'civicrm_acl_entity_role'                  => '`civicrm_`',
  'civicrm_action_log'                       => '`civicrm_`',
  'civicrm_action_mapping'                   => '`civicrm_`',
  'civicrm_action_schedule'                  => '`civicrm_`',
  'civicrm_activity'                         => '`civicrm_`',
  'civicrm_activity_assignment'              => '`civicrm_`',
  'civicrm_activity_target'                  => '`civicrm_`',
  'civicrm_address'                          => '`civicrm_`',
  'civicrm_address_format'                   => '`civicrm_`',
  'civicrm_batch'                            => '`civicrm_`',
  'civicrm_cache'                            => '`civicrm_`',
  'civicrm_campaign'                         => '`civicrm_`',
  'civicrm_campaign_group'                   => '`civicrm_`',
  'civicrm_case'                             => '`civicrm_`',
  'civicrm_case_activity'                    => '`civicrm_`',
  'civicrm_case_contact'                     => '`civicrm_`',
  'civicrm_component'                        => '`civicrm_`',
  'civicrm_contact'                          => '`civicrm_`',
  'civicrm_contact_type'                     => '`civicrm_`',
  'civicrm_contribution'                     => '`civicrm_`',
  'civicrm_contribution_page'                => '`civicrm_`',
  'civicrm_contribution_product'             => '`civicrm_`',
  'civicrm_contribution_recur'               => '`civicrm_`',
  'civicrm_contribution_soft'                => '`civicrm_`',
  'civicrm_contribution_type'                => '`civicrm_`',
  'civicrm_contribution_widget'              => '`civicrm_`',
  'civicrm_country'                          => '`civicrm_`',
  'civicrm_county'                           => '`civicrm_`',
  'civicrm_currency'                         => '`civicrm_`',
  'civicrm_custom_field'                     => '`civicrm_`',
  'civicrm_custom_group'                     => '`civicrm_`',
  'civicrm_dashboard'                        => '`civicrm_`',
  'civicrm_dashboard_contact'                => '`civicrm_`',
  'civicrm_dedupe_exception'                 => '`civicrm_`',
  'civicrm_dedupe_rule'                      => '`civicrm_`',
  'civicrm_dedupe_rule_group'                => '`civicrm_`',
  'civicrm_discount'                         => '`civicrm_`',
  'civicrm_domain'                           => '`civicrm_`',
  'civicrm_email'                            => '`civicrm_`',
  'civicrm_entity_batch'                     => '`civicrm_`',
  'civicrm_entity_file'                      => '`civicrm_`',
  'civicrm_entity_financial_trxn'            => '`civicrm_`',
  'civicrm_entity_tag'                       => '`civicrm_`',
  'civicrm_event'                            => '`civicrm_`',
  'civicrm_file'                             => '`civicrm_`',
  'civicrm_financial_account'                => '`civicrm_`',
  'civicrm_financial_trxn'                   => '`civicrm_`',
  'civicrm_grant'                            => '`civicrm_`',
  'civicrm_group'                            => '`civicrm_`',
  'civicrm_group_contact'                    => '`civicrm_`',
  'civicrm_group_contact_cache'              => '`civicrm_`',
  'civicrm_group_nesting'                    => '`civicrm_`',
  'civicrm_group_organization'               => '`civicrm_`',
  'civicrm_im'                               => '`civicrm_`',
  'civicrm_line_item'                        => '`civicrm_`',
  'civicrm_loc_block'                        => '`civicrm_`',
  'civicrm_location_type'                    => '`civicrm_`',
  'civicrm_log'                              => '`civicrm_`',
  'civicrm_mail_settings'                    => '`civicrm_`',
  'civicrm_mailing'                          => '`civicrm_`',
  'civicrm_mailing_bounce_pattern'           => '`civicrm_`',
  'civicrm_mailing_bounce_type'              => '`civicrm_`',
  'civicrm_mailing_component'                => '`civicrm_`',
  'civicrm_mailing_event_bounce'             => '`civicrm_`',
  'civicrm_mailing_event_confirm'            => '`civicrm_`',
  'civicrm_mailing_event_delivered'          => '`civicrm_`',
  'civicrm_mailing_event_forward'            => '`civicrm_`',
  'civicrm_mailing_event_opened'             => '`civicrm_`',
  'civicrm_mailing_event_queue'              => '`civicrm_`',
  'civicrm_mailing_event_reply'              => '`civicrm_`',
  'civicrm_mailing_event_subscribe'          => '`civicrm_`',
  'civicrm_mailing_event_trackable_url_open' => '`civicrm_`',
  'civicrm_mailing_event_unsubscribe'        => '`civicrm_`',
  'civicrm_mailing_group'                    => '`civicrm_`',
  'civicrm_mailing_job'                      => '`civicrm_`',
  'civicrm_mailing_recipients'               => '`civicrm_`',
  'civicrm_mailing_spool'                    => '`civicrm_`',
  'civicrm_mailing_trackable_url'            => '`civicrm_`',
  'civicrm_mapping'                          => '`civicrm_`',
  'civicrm_mapping_field'                    => '`civicrm_`',
  'civicrm_membership'                       => '`civicrm_`',
  'civicrm_membership_block'                 => '`civicrm_`',
  'civicrm_membership_log'                   => '`civicrm_`',
  'civicrm_membership_payment'               => '`civicrm_`',
  'civicrm_membership_status'                => '`civicrm_`',
  'civicrm_membership_type'                  => '`civicrm_`',
  'civicrm_menu'                             => '`civicrm_`',
  'civicrm_navigation'                       => '`civicrm_`',
  'civicrm_note'                             => '`civicrm_`',
  'civicrm_openid'                           => '`civicrm_`',
  'civicrm_option_group'                     => '`civicrm_`',
  'civicrm_option_value'                     => '`civicrm_`',
  'civicrm_participant'                      => '`civicrm_`',
  'civicrm_participant_payment'              => '`civicrm_`',
  'civicrm_participant_status_type'          => '`civicrm_`',
  'civicrm_payment_processor'                => '`civicrm_`',
  'civicrm_payment_processor_type'           => '`civicrm_`',
  'civicrm_pcp'                              => '`civicrm_`',
  'civicrm_pcp_block'                        => '`civicrm_`',
  'civicrm_persistent'                       => '`civicrm_`',
  'civicrm_phone'                            => '`civicrm_`',
  'civicrm_pledge'                           => '`civicrm_`',
  'civicrm_pledge_block'                     => '`civicrm_`',
  'civicrm_pledge_payment'                   => '`civicrm_`',
  'civicrm_preferences'                      => '`civicrm_`',
  'civicrm_preferences_date'                 => '`civicrm_`',
  'civicrm_premiums'                         => '`civicrm_`',
  'civicrm_premiums_product'                 => '`civicrm_`',
  'civicrm_prevnext_cache'                   => '`civicrm_`',
  'civicrm_price_field'                      => '`civicrm_`',
  'civicrm_price_field_value'                => '`civicrm_`',
  'civicrm_price_set'                        => '`civicrm_`',
  'civicrm_price_set_entity'                 => '`civicrm_`',
  'civicrm_product'                          => '`civicrm_`',
  'civicrm_project'                          => '`civicrm_`',
  'civicrm_relationship'                     => '`civicrm_`',
  'civicrm_relationship_type'                => '`civicrm_`',
  'civicrm_report_instance'                  => '`civicrm_`',
  'civicrm_saved_search'                     => '`civicrm_`',
  'civicrm_state_province'                   => '`civicrm_`',
  'civicrm_subscription_history'             => '`civicrm_`',
  'civicrm_survey'                           => '`civicrm_`',
  'civicrm_tag'                              => '`civicrm_`',
  'civicrm_task'                             => '`civicrm_`',
  'civicrm_task_status'                      => '`civicrm_`',
  'civicrm_tell_friend'                      => '`civicrm_`',
  'civicrm_timezone'                         => '`civicrm_`',
  'civicrm_uf_field'                         => '`civicrm_`',
  'civicrm_uf_group'                         => '`civicrm_`',
  'civicrm_uf_join'                          => '`civicrm_`',
  'civicrm_uf_match'                         => '`civicrm_`',
  'civicrm_website'                          => '`civicrm_`',
  'civicrm_worldregion'                      => '`civicrm_`',
);
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.

cognoscento

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Views 3 integration
September 20, 2011, 03:03:33 am
Progress is a good thing... Views is starting to act more reasonably now; I can select CiviCRM fields to build views now, but when I build  really simple view (like one that shows the member's display name when their status is new, current or grace) views gives the following error:

Code: [Select]
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'civicrm_membership LEFT JOIN `civicrm_`civicrm_contact civicrm_contact ON civicr' at line 1
The query that views is generating is as follows:

Code: [Select]
SELECT civicrm_contact.display_name AS civicrm_contact_display_name, civicrm_contact.id AS civicrm_contact_id, civicrm_membership.status_id AS civicrm_membership_status_id
FROM
{civicrm_membership} civicrm_membership
LEFT JOIN {civicrm_contact} civicrm_contact ON civicrm_membership.contact_id = civicrm_contact.id
WHERE (( (civicrm_membership.status_id IN  ('1', '2', '3')) ))

Something's still not right, but I can't figure out what it is...



Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Views 3 integration
September 20, 2011, 03:07:42 am
Try

Code: [Select]
$databases['default']['default']['prefix']= array(
  'default'                                    => 'drupal_',
  'civicrm_acl'                              => '',
  'civicrm_acl_cache'                        => '',
  'civicrm_acl_contact_cache'                => '',
  'civicrm_acl_entity_role'                  => '',
  'civicrm_action_log'                       => '',
  'civicrm_action_mapping'                   => '',
  'civicrm_action_schedule'                  => '',
  'civicrm_activity'                         => '',
  'civicrm_activity_assignment'              => '',
  'civicrm_activity_target'                  => '',
  'civicrm_address'                          => '',
  'civicrm_address_format'                   => '',
  'civicrm_batch'                            => '',
  'civicrm_cache'                            => '',
  'civicrm_campaign'                         => '',
  'civicrm_campaign_group'                   => '',
  'civicrm_case'                             => '',
  'civicrm_case_activity'                    => '',
  'civicrm_case_contact'                     => '',
  'civicrm_component'                        => '',
  'civicrm_contact'                          => '',
  'civicrm_contact_type'                     => '',
  'civicrm_contribution'                     => '',
  'civicrm_contribution_page'                => '',
  'civicrm_contribution_product'             => '',
  'civicrm_contribution_recur'               => '',
  'civicrm_contribution_soft'                => '',
  'civicrm_contribution_type'                => '',
  'civicrm_contribution_widget'              => '',
  'civicrm_country'                          => '',
  'civicrm_county'                           => '',
  'civicrm_currency'                         => '',
  'civicrm_custom_field'                     => '',
  'civicrm_custom_group'                     => '',
  'civicrm_dashboard'                        => '',
  'civicrm_dashboard_contact'                => '',
  'civicrm_dedupe_exception'                 => '',
  'civicrm_dedupe_rule'                      => '',
  'civicrm_dedupe_rule_group'                => '',
  'civicrm_discount'                         => '',
  'civicrm_domain'                           => '',
  'civicrm_email'                            => '',
  'civicrm_entity_batch'                     => '',
  'civicrm_entity_file'                      => '',
  'civicrm_entity_financial_trxn'            => '',
  'civicrm_entity_tag'                       => '',
  'civicrm_event'                            => '',
  'civicrm_file'                             => '',
  'civicrm_financial_account'                => '',
  'civicrm_financial_trxn'                   => '',
  'civicrm_grant'                            => '',
  'civicrm_group'                            => '',
  'civicrm_group_contact'                    => '',
  'civicrm_group_contact_cache'              => '',
  'civicrm_group_nesting'                    => '',
  'civicrm_group_organization'               => '',
  'civicrm_im'                               => '',
  'civicrm_line_item'                        => '',
  'civicrm_loc_block'                        => '',
  'civicrm_location_type'                    => '',
  'civicrm_log'                              => '',
  'civicrm_mail_settings'                    => '',
  'civicrm_mailing'                          => '',
  'civicrm_mailing_bounce_pattern'           => '',
  'civicrm_mailing_bounce_type'              => '',
  'civicrm_mailing_component'                => '',
  'civicrm_mailing_event_bounce'             => '',
  'civicrm_mailing_event_confirm'            => '',
  'civicrm_mailing_event_delivered'          => '',
  'civicrm_mailing_event_forward'            => '',
  'civicrm_mailing_event_opened'             => '',
  'civicrm_mailing_event_queue'              => '',
  'civicrm_mailing_event_reply'              => '',
  'civicrm_mailing_event_subscribe'          => '',
  'civicrm_mailing_event_trackable_url_open' => '',
  'civicrm_mailing_event_unsubscribe'        => '',
  'civicrm_mailing_group'                    => '',
  'civicrm_mailing_job'                      => '',
  'civicrm_mailing_recipients'               => '',
  'civicrm_mailing_spool'                    => '',
  'civicrm_mailing_trackable_url'            => '',
  'civicrm_mapping'                          => '',
  'civicrm_mapping_field'                    => '',
  'civicrm_membership'                       => '',
  'civicrm_membership_block'                 => '',
  'civicrm_membership_log'                   => '',
  'civicrm_membership_payment'               => '',
  'civicrm_membership_status'                => '',
  'civicrm_membership_type'                  => '',
  'civicrm_menu'                             => '',
  'civicrm_navigation'                       => '',
  'civicrm_note'                             => '',
  'civicrm_openid'                           => '',
  'civicrm_option_group'                     => '',
  'civicrm_option_value'                     => '',
  'civicrm_participant'                      => '',
  'civicrm_participant_payment'              => '',
  'civicrm_participant_status_type'          => '',
  'civicrm_payment_processor'                => '',
  'civicrm_payment_processor_type'           => '',
  'civicrm_pcp'                              => '',
  'civicrm_pcp_block'                        => '',
  'civicrm_persistent'                       => '',
  'civicrm_phone'                            => '',
  'civicrm_pledge'                           => '',
  'civicrm_pledge_block'                     => '',
  'civicrm_pledge_payment'                   => '',
  'civicrm_preferences'                      => '',
  'civicrm_preferences_date'                 => '',
  'civicrm_premiums'                         => '',
  'civicrm_premiums_product'                 => '',
  'civicrm_prevnext_cache'                   => '',
  'civicrm_price_field'                      => '',
  'civicrm_price_field_value'                => '',
  'civicrm_price_set'                        => '',
  'civicrm_price_set_entity'                 => '',
  'civicrm_product'                          => '',
  'civicrm_project'                          => '',
  'civicrm_relationship'                     => '',
  'civicrm_relationship_type'                => '',
  'civicrm_report_instance'                  => '',
  'civicrm_saved_search'                     => '',
  'civicrm_state_province'                   => '',
  'civicrm_subscription_history'             => '',
  'civicrm_survey'                           => '',
  'civicrm_tag'                              => '',
  'civicrm_task'                             => '',
  'civicrm_task_status'                      => '',
  'civicrm_tell_friend'                      => '',
  'civicrm_timezone'                         => '',
  'civicrm_uf_field'                         => '',
  'civicrm_uf_group'                         => '',
  'civicrm_uf_join'                          => '',
  'civicrm_uf_match'                         => '',
  'civicrm_website'                          => '',
  'civicrm_worldregion'                      => '',
);
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.

cognoscento

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 1
  • CiviCRM version: 4.2
  • CMS version: Drupal 7.17
  • MySQL version: 5.1.65
  • PHP version: 5.3.17
Re: Views 3 integration
September 22, 2011, 07:05:23 am
That worked, thanks! (Any idea why that never showed up on the CMS Integration page?)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Views 3 integration
September 22, 2011, 07:08:22 am
Glad to hear you got it.

> Any idea why that never showed up on the CMS Integration page?

No. :(
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.

andersiversen

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Views 3 integration
September 29, 2011, 03:05:39 pm
Just wanted to chip in, that I had the same error, and adding

Code: [Select]
'default'                                    => 'my_drupal_database_prefix',
solved the issue for me as well.

How do we make sure that this get added on http://yourdomain.com/civicrm/admin/setting/uf?reset=1 in the next update of civicrm ?

Cheers :)

andersiversen

  • I post occasionally
  • **
  • Posts: 76
  • Karma: 1
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Views 3 integration
September 29, 2011, 05:35:06 pm
Well the PDOExeption dissappeared, but I cannot see anything Civicrm in views

In my settings.php:
Code: [Select]
$databases['default']['default'] = array('driver' => 'mysql',
                   'database' => 'drupal',
                   'username' => 'drupal_user',
                   'password' => 'drupal_password',
                   'host' => 'localhost',
                   'port' => 3306,
                   'prefix' => 'drupal_',
                   'collation' => 'utf8_general_ci',);

$databases['default']['default']['prefix']= array(
  'default'                                  => 'drupal_',
  'civicrm_acl'                              => '`civicrm`.',
  'civicrm_acl_cache'                        => '`civicrm`.',
  ....
  );

I have followed the guide in the docs here http://wiki.civicrm.org/confluence/display/CRMDOC40/Views3+Integration

The Civicrm and drupal databases are different, but both on localhost. They have different users.

I have granted select privileges to the drupal_user on the civicrm database (and flushed privileges after granting).

I've cleared cache both in settings and in views. I've also tried to run update.php (no updates)

Do I need to do anything else? I don't have anything from civicrm appaering in views.

Thanks in advance!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Views 3 integration
September 29, 2011, 05:41:55 pm

Provide a patch and attach it to the issue :)

the code is here: CRM/Admin/Form/Setting/UF.php

Note that the patch needs to be against 4.0 or 4.1. the format has changed a bit between D6 and D7

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

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

This forum was archived on 2017-11-26.