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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Problem with Drupal 7, Views 3 and Multiple CiviCRM languages
Pages: [1]

Author Topic: Problem with Drupal 7, Views 3 and Multiple CiviCRM languages  (Read 1408 times)

wrender

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Problem with Drupal 7, Views 3 and Multiple CiviCRM languages
May 22, 2012, 09:26:50 am
We have CiviCRM installed, and integrated with views 3 in drupal 7.  All was working well and then we decided to enable another language in CiviCRM.  After the second language was installed, we adjusted the settings.php file in Drupal 7 to reflect the new arrays (see below).   Now, when we build a view and try to insert the "event title" field we get the following error.  It seems as though views is not picking up the multilingual fields for some reason.  Are CiviCRM multi-languages not supported by Drupal 7 Views 3?

Code: [Select]
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_event.title' in 'field list'
our settings.php file:
Code: [Select]
$databases['default']['default']['prefix']= array(
  'civicrm_acl'                              => '`winterst_devcivi`.',
  'civicrm_acl_cache'                        => '`winterst_devcivi`.',
  'civicrm_acl_contact_cache'                => '`winterst_devcivi`.',
  'civicrm_acl_entity_role'                  => '`winterst_devcivi`.',
  'civicrm_action_log'                       => '`winterst_devcivi`.',
  'civicrm_action_mapping'                   => '`winterst_devcivi`.',
  'civicrm_action_schedule'                  => '`winterst_devcivi`.',
  'civicrm_activity'                         => '`winterst_devcivi`.',
  'civicrm_activity_assignment'              => '`winterst_devcivi`.',
  'civicrm_activity_target'                  => '`winterst_devcivi`.',
  'civicrm_address'                          => '`winterst_devcivi`.',
  'civicrm_address_format'                   => '`winterst_devcivi`.',
  'civicrm_batch'                            => '`winterst_devcivi`.',
  'civicrm_batch_en_US'                      => '`winterst_devcivi`.',
  'civicrm_batch_fr_CA'                      => '`winterst_devcivi`.',
  'civicrm_cache'                            => '`winterst_devcivi`.',
  'civicrm_campaign'                         => '`winterst_devcivi`.',
  'civicrm_campaign_group'                   => '`winterst_devcivi`.',
  'civicrm_case'                             => '`winterst_devcivi`.',
  'civicrm_case_activity'                    => '`winterst_devcivi`.',
  'civicrm_case_contact'                     => '`winterst_devcivi`.',
  'civicrm_component'                        => '`winterst_devcivi`.',
  'civicrm_contact'                          => '`winterst_devcivi`.',
  'civicrm_contact_type'                     => '`winterst_devcivi`.',
  'civicrm_contact_type_en_US'               => '`winterst_devcivi`.',
  'civicrm_contact_type_fr_CA'               => '`winterst_devcivi`.',
  'civicrm_contribution'                     => '`winterst_devcivi`.',
  'civicrm_contribution_page'                => '`winterst_devcivi`.',
  'civicrm_contribution_page_en_US'          => '`winterst_devcivi`.',
  'civicrm_contribution_page_fr_CA'          => '`winterst_devcivi`.',
  'civicrm_contribution_product'             => '`winterst_devcivi`.',
  'civicrm_contribution_recur'               => '`winterst_devcivi`.',
  'civicrm_contribution_soft'                => '`winterst_devcivi`.',
  'civicrm_contribution_type'                => '`winterst_devcivi`.',
  'civicrm_contribution_widget'              => '`winterst_devcivi`.',
  'civicrm_country'                          => '`winterst_devcivi`.',
  'civicrm_county'                           => '`winterst_devcivi`.',
  'civicrm_currency'                         => '`winterst_devcivi`.',
  'civicrm_custom_field'                     => '`winterst_devcivi`.',
  'civicrm_custom_field_en_US'               => '`winterst_devcivi`.',
  'civicrm_custom_field_fr_CA'               => '`winterst_devcivi`.',
  'civicrm_custom_group'                     => '`winterst_devcivi`.',
  'civicrm_custom_group_en_US'               => '`winterst_devcivi`.',
  'civicrm_custom_group_fr_CA'               => '`winterst_devcivi`.',
  'civicrm_dashboard'                        => '`winterst_devcivi`.',
  'civicrm_dashboard_contact'                => '`winterst_devcivi`.',
  'civicrm_dashboard_en_US'                  => '`winterst_devcivi`.',
  'civicrm_dashboard_fr_CA'                  => '`winterst_devcivi`.',
  'civicrm_dedupe_exception'                 => '`winterst_devcivi`.',
  'civicrm_dedupe_rule'                      => '`winterst_devcivi`.',
  'civicrm_dedupe_rule_group'                => '`winterst_devcivi`.',
  'civicrm_discount'                         => '`winterst_devcivi`.',
  'civicrm_domain'                           => '`winterst_devcivi`.',
  'civicrm_email'                            => '`winterst_devcivi`.',
  'civicrm_entity_batch'                     => '`winterst_devcivi`.',
  'civicrm_entity_file'                      => '`winterst_devcivi`.',
  'civicrm_entity_financial_trxn'            => '`winterst_devcivi`.',
  'civicrm_entity_tag'                       => '`winterst_devcivi`.',
  'civicrm_event'                            => '`winterst_devcivi`.',
  'civicrm_event_carts'                      => '`winterst_devcivi`.',
  'civicrm_event_en_US'                      => '`winterst_devcivi`.',
  'civicrm_event_fr_CA'                      => '`winterst_devcivi`.',
  'civicrm_events_in_carts'                  => '`winterst_devcivi`.',
  'civicrm_file'                             => '`winterst_devcivi`.',
  'civicrm_financial_account'                => '`winterst_devcivi`.',
  'civicrm_financial_trxn'                   => '`winterst_devcivi`.',
  'civicrm_grant'                            => '`winterst_devcivi`.',
  'civicrm_group'                            => '`winterst_devcivi`.',
  'civicrm_group_contact'                    => '`winterst_devcivi`.',
  'civicrm_group_contact_cache'              => '`winterst_devcivi`.',
  'civicrm_group_nesting'                    => '`winterst_devcivi`.',
  'civicrm_group_organization'               => '`winterst_devcivi`.',
  'civicrm_im'                               => '`winterst_devcivi`.',
  'civicrm_job'                              => '`winterst_devcivi`.',
  'civicrm_job_log'                          => '`winterst_devcivi`.',
  'civicrm_line_item'                        => '`winterst_devcivi`.',
  'civicrm_loc_block'                        => '`winterst_devcivi`.',
  'civicrm_location_type'                    => '`winterst_devcivi`.',
  'civicrm_location_type_en_US'              => '`winterst_devcivi`.',
  'civicrm_location_type_fr_CA'              => '`winterst_devcivi`.',
  'civicrm_log'                              => '`winterst_devcivi`.',
  'civicrm_mail_settings'                    => '`winterst_devcivi`.',
  'civicrm_mailing'                          => '`winterst_devcivi`.',
  'civicrm_mailing_bounce_pattern'           => '`winterst_devcivi`.',
  'civicrm_mailing_bounce_type'              => '`winterst_devcivi`.',
  'civicrm_mailing_component'                => '`winterst_devcivi`.',
  'civicrm_mailing_event_bounce'             => '`winterst_devcivi`.',
  'civicrm_mailing_event_confirm'            => '`winterst_devcivi`.',
  'civicrm_mailing_event_delivered'          => '`winterst_devcivi`.',
  'civicrm_mailing_event_forward'            => '`winterst_devcivi`.',
  'civicrm_mailing_event_opened'             => '`winterst_devcivi`.',
  'civicrm_mailing_event_queue'              => '`winterst_devcivi`.',
  'civicrm_mailing_event_reply'              => '`winterst_devcivi`.',
  'civicrm_mailing_event_subscribe'          => '`winterst_devcivi`.',
  'civicrm_mailing_event_trackable_url_open' => '`winterst_devcivi`.',
  'civicrm_mailing_event_unsubscribe'        => '`winterst_devcivi`.',
  'civicrm_mailing_group'                    => '`winterst_devcivi`.',
  'civicrm_mailing_job'                      => '`winterst_devcivi`.',
  'civicrm_mailing_recipients'               => '`winterst_devcivi`.',
  'civicrm_mailing_spool'                    => '`winterst_devcivi`.',
  'civicrm_mailing_trackable_url'            => '`winterst_devcivi`.',
  'civicrm_mapping'                          => '`winterst_devcivi`.',
  'civicrm_mapping_field'                    => '`winterst_devcivi`.',
  'civicrm_membership'                       => '`winterst_devcivi`.',
  'civicrm_membership_block'                 => '`winterst_devcivi`.',
  'civicrm_membership_block_en_US'           => '`winterst_devcivi`.',
  'civicrm_membership_block_fr_CA'           => '`winterst_devcivi`.',
  'civicrm_membership_log'                   => '`winterst_devcivi`.',
  'civicrm_membership_payment'               => '`winterst_devcivi`.',
  'civicrm_membership_status'                => '`winterst_devcivi`.',
  'civicrm_membership_status_en_US'          => '`winterst_devcivi`.',
  'civicrm_membership_status_fr_CA'          => '`winterst_devcivi`.',
  'civicrm_membership_type'                  => '`winterst_devcivi`.',
  'civicrm_membership_type_en_US'            => '`winterst_devcivi`.',
  'civicrm_membership_type_fr_CA'            => '`winterst_devcivi`.',
  'civicrm_menu'                             => '`winterst_devcivi`.',
  'civicrm_navigation'                       => '`winterst_devcivi`.',
  'civicrm_note'                             => '`winterst_devcivi`.',
  'civicrm_openid'                           => '`winterst_devcivi`.',
  'civicrm_option_group'                     => '`winterst_devcivi`.',
  'civicrm_option_group_en_US'               => '`winterst_devcivi`.',
  'civicrm_option_group_fr_CA'               => '`winterst_devcivi`.',
  'civicrm_option_value'                     => '`winterst_devcivi`.',
  'civicrm_option_value_en_US'               => '`winterst_devcivi`.',
  'civicrm_option_value_fr_CA'               => '`winterst_devcivi`.',
  'civicrm_participant'                      => '`winterst_devcivi`.',
  'civicrm_participant_payment'              => '`winterst_devcivi`.',
  'civicrm_participant_status_type'          => '`winterst_devcivi`.',
  'civicrm_participant_status_type_en_US'    => '`winterst_devcivi`.',
  'civicrm_participant_status_type_fr_CA'    => '`winterst_devcivi`.',
  'civicrm_payment_processor'                => '`winterst_devcivi`.',
  'civicrm_payment_processor_type'           => '`winterst_devcivi`.',
  'civicrm_pcp'                              => '`winterst_devcivi`.',
  'civicrm_pcp_block'                        => '`winterst_devcivi`.',
  'civicrm_pcp_block_en_US'                  => '`winterst_devcivi`.',
  'civicrm_pcp_block_fr_CA'                  => '`winterst_devcivi`.',
  'civicrm_persistent'                       => '`winterst_devcivi`.',
  'civicrm_phone'                            => '`winterst_devcivi`.',
  'civicrm_pledge'                           => '`winterst_devcivi`.',
  'civicrm_pledge_block'                     => '`winterst_devcivi`.',
  'civicrm_pledge_payment'                   => '`winterst_devcivi`.',
  'civicrm_preferences_date'                 => '`winterst_devcivi`.',
  'civicrm_premiums'                         => '`winterst_devcivi`.',
  'civicrm_premiums_en_US'                   => '`winterst_devcivi`.',
  'civicrm_premiums_fr_CA'                   => '`winterst_devcivi`.',
  'civicrm_premiums_product'                 => '`winterst_devcivi`.',
  'civicrm_prevnext_cache'                   => '`winterst_devcivi`.',
  'civicrm_price_field'                      => '`winterst_devcivi`.',
  'civicrm_price_field_en_US'                => '`winterst_devcivi`.',
  'civicrm_price_field_fr_CA'                => '`winterst_devcivi`.',
  'civicrm_price_field_value'                => '`winterst_devcivi`.',
  'civicrm_price_field_value_en_US'          => '`winterst_devcivi`.',
  'civicrm_price_field_value_fr_CA'          => '`winterst_devcivi`.',
  'civicrm_price_set'                        => '`winterst_devcivi`.',
  'civicrm_price_set_en_US'                  => '`winterst_devcivi`.',
  'civicrm_price_set_entity'                 => '`winterst_devcivi`.',
  'civicrm_price_set_fr_CA'                  => '`winterst_devcivi`.',
  'civicrm_product'                          => '`winterst_devcivi`.',
  'civicrm_product_en_US'                    => '`winterst_devcivi`.',
  'civicrm_product_fr_CA'                    => '`winterst_devcivi`.',
  'civicrm_project'                          => '`winterst_devcivi`.',
  'civicrm_relationship'                     => '`winterst_devcivi`.',
  'civicrm_relationship_type'                => '`winterst_devcivi`.',
  'civicrm_report_instance'                  => '`winterst_devcivi`.',
  'civicrm_saved_search'                     => '`winterst_devcivi`.',
  'civicrm_setting'                          => '`winterst_devcivi`.',
  'civicrm_state_province'                   => '`winterst_devcivi`.',
  'civicrm_subscription_history'             => '`winterst_devcivi`.',
  'civicrm_survey'                           => '`winterst_devcivi`.',
  'civicrm_tag'                              => '`winterst_devcivi`.',
  'civicrm_task'                             => '`winterst_devcivi`.',
  'civicrm_task_status'                      => '`winterst_devcivi`.',
  'civicrm_tell_friend'                      => '`winterst_devcivi`.',
  'civicrm_tell_friend_en_US'                => '`winterst_devcivi`.',
  'civicrm_tell_friend_fr_CA'                => '`winterst_devcivi`.',
  'civicrm_timezone'                         => '`winterst_devcivi`.',
  'civicrm_uf_field'                         => '`winterst_devcivi`.',
  'civicrm_uf_field_en_US'                   => '`winterst_devcivi`.',
  'civicrm_uf_field_fr_CA'                   => '`winterst_devcivi`.',
  'civicrm_uf_group'                         => '`winterst_devcivi`.',
  'civicrm_uf_group_en_US'                   => '`winterst_devcivi`.',
  'civicrm_uf_group_fr_CA'                   => '`winterst_devcivi`.',
  'civicrm_uf_join'                          => '`winterst_devcivi`.',
  'civicrm_uf_match'                         => '`winterst_devcivi`.',
  'civicrm_value_additional_fields_2'        => '`winterst_devcivi`.',
  'civicrm_value_additional_profile_info_3'  => '`winterst_devcivi`.',
  'civicrm_value_build_week_5'               => '`winterst_devcivi`.',
  'civicrm_value_ladies_week_4'              => '`winterst_devcivi`.',
  'civicrm_website'                          => '`winterst_devcivi`.',
  'civicrm_worldregion'                      => '`winterst_devcivi`.',
);
« Last Edit: May 22, 2012, 09:31:00 am by wrender »

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: Problem with Drupal 7, Views 3 and Multiple CiviCRM languages
May 22, 2012, 09:43:05 am

pretty sure the views3 integration code does not support multi-lingual

I'm not sure how easy or hard it would be to do so. The multi-lingual code basically switches views and tables and does some query rewrites to work. Will be a bit hard to get views3 to do the same

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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Problem with Drupal 7, Views 3 and Multiple CiviCRM languages
May 23, 2012, 02:11:38 pm
Quote from: Donald Lobo on May 22, 2012, 09:43:05 am
pretty sure the views3 integration code does not support multi-lingual

Seems correct. I have a report from a colleague that even after he removed multilingual from CiviCRM, the Views integration remained broken. :(
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.

kafmil

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • MySQL version: 5.095
  • PHP version: 5.2.17
Re: Problem with Drupal 7, Views 3 and Multiple CiviCRM languages
November 06, 2012, 11:06:36 pm
This is fixable, you need a custom module to change the field names within views. This module is for views 3 and drupal 7, it is assuming Australian is the default language, then only checking for Vietnamese as an alternative. It is also only checking the title and summary fields. This could easily be reconfigured to accept more languages and more fields. Hope this helps someone out there.
views_override.module
Code: [Select]
<?php

function views_override_views_query_alter(&$view, &$query) {
  if(
$view->name == 'cooking_classes') 
  { 
    
$lang_suffix = '_en_AU';
    if (
$GLOBALS['language']->language == 'vi') {
      
$lang_suffix = '_vi_VN';
    }
    foreach (
$query->fields as &$fieldlist) {
      if (
$fieldlist['field'] == 'title') {
        
$fieldlist['field'] = $fieldlist['field'].$lang_suffix;
      }
      if (
$fieldlist['field'] == 'summary') {
        
$fieldlist['field'] = $fieldlist['field'].$lang_suffix;
      }
    }
  }
}
And the views_override.info file
Code: [Select]
name = Views Override
description = A place to put custom SQL to use in views
package = Views
core = 7.x
files[] =

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Problem with Drupal 7, Views 3 and Multiple CiviCRM languages

This forum was archived on 2017-11-26.