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 & custom fields
Pages: [1]

Author Topic: Views & custom fields  (Read 2298 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Views & custom fields
April 10, 2009, 03:47:15 pm
It appears like some types of custom fields are exposed to Views but not those attached to events - is that correct?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Views & custom fields
April 11, 2009, 06:50:55 pm
Should be all custom fields, at least there is place in code that looks for Events data:

Code: [Select]
function civicrm_views_custom_data_cache($data, $entity_type, $groupID, $subType, $style) {

...

switch ($entity_type) {
             
    case "Contact":
    case "Individual":
    case "Household":
    case "Organization":
        $jointable = 'civicrm_contact';
        break;
    case "Event":
        $jointable = 'civicrm_event';
        break;

Could you please check that you have updated settings.php with renaming conventions for your (probably new) custom fields group?

from http://wiki.civicrm.org/confluence/display/CRMDOC/Views2+Integration+Module

Important: You will have to update your settings.php with new prefixes every time you add new Custom Field Group.  Also, after making changes in civicrm you should clear Drupal's view cache at:  Administer › Site building › Views › Tools and press "Clear Views cache".

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views & custom fields
April 12, 2009, 07:02:37 pm
Hi,

Thanks, I didn't know about that. From what I gather from the wiki page the data to add to settings.php should be generated on my Home › CiviCRM › Administer CiviCRM › Global Settings
Settings - Drupal Integration page but I don't get the data on my 2.2.2 page that shows on the demo. Is it because the patch to generate it is only new? Or should I be doing something?
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Views & custom fields
April 12, 2009, 11:15:13 pm
Hi, Eileen.

It should be there by default - I think this feature appeared somewhere around 2.1.

If it's not showing, while you are investigating why it's not there, you may just check custom fields table name in phpmyadmin and change relevant values in the table from demo site:

Code: [Select]
$db_prefix = array(
  'civicrm_acl'                              => 'civicrm_demo_drupal.',
  'civicrm_acl_cache'                        => 'civicrm_demo_drupal.',
  'civicrm_acl_entity_role'                  => 'civicrm_demo_drupal.',
  'civicrm_activity'                         => 'civicrm_demo_drupal.',
  'civicrm_activity_assignment'              => 'civicrm_demo_drupal.',
  'civicrm_activity_target'                  => 'civicrm_demo_drupal.',
  'civicrm_address'                          => 'civicrm_demo_drupal.',
  'civicrm_cache'                            => 'civicrm_demo_drupal.',
  'civicrm_case'                             => 'civicrm_demo_drupal.',
  'civicrm_case_activity'                    => 'civicrm_demo_drupal.',
  'civicrm_case_contact'                     => 'civicrm_demo_drupal.',
  'civicrm_component'                        => 'civicrm_demo_drupal.',
  'civicrm_contact'                          => 'civicrm_demo_drupal.',
  'civicrm_contribution'                     => 'civicrm_demo_drupal.',
  'civicrm_contribution_page'                => 'civicrm_demo_drupal.',
  'civicrm_contribution_product'             => 'civicrm_demo_drupal.',
  'civicrm_contribution_recur'               => 'civicrm_demo_drupal.',
  'civicrm_contribution_soft'                => 'civicrm_demo_drupal.',
  'civicrm_contribution_type'                => 'civicrm_demo_drupal.',
  'civicrm_contribution_widget'              => 'civicrm_demo_drupal.',
  'civicrm_country'                          => 'civicrm_demo_drupal.',
  'civicrm_county'                           => 'civicrm_demo_drupal.',
  'civicrm_currency'                         => 'civicrm_demo_drupal.',
  'civicrm_custom_field'                     => 'civicrm_demo_drupal.',
  'civicrm_custom_group'                     => 'civicrm_demo_drupal.',
  'civicrm_dedupe_rule'                      => 'civicrm_demo_drupal.',
  'civicrm_dedupe_rule_group'                => 'civicrm_demo_drupal.',
  'civicrm_discount'                         => 'civicrm_demo_drupal.',
  'civicrm_domain'                           => 'civicrm_demo_drupal.',
  'civicrm_email'                            => 'civicrm_demo_drupal.',
  'civicrm_entity_file'                      => 'civicrm_demo_drupal.',
  'civicrm_entity_tag'                       => 'civicrm_demo_drupal.',
  'civicrm_event'                            => 'civicrm_demo_drupal.',
  'civicrm_file'                             => 'civicrm_demo_drupal.',
  'civicrm_financial_trxn'                   => 'civicrm_demo_drupal.',
  'civicrm_grant'                            => 'civicrm_demo_drupal.',
  'civicrm_group'                            => 'civicrm_demo_drupal.',
  'civicrm_group_contact'                    => 'civicrm_demo_drupal.',
  'civicrm_group_contact_cache'              => 'civicrm_demo_drupal.',
  'civicrm_group_nesting'                    => 'civicrm_demo_drupal.',
  'civicrm_group_organization'               => 'civicrm_demo_drupal.',
  'civicrm_im'                               => 'civicrm_demo_drupal.',
  'civicrm_import_job_657c9cf831d1e2198179afa0cd35a251' => 'civicrm_demo_drupal.',
  'civicrm_line_item'                        => 'civicrm_demo_drupal.',
  'civicrm_loc_block'                        => 'civicrm_demo_drupal.',
  'civicrm_location_type'                    => 'civicrm_demo_drupal.',
  'civicrm_log'                              => 'civicrm_demo_drupal.',
  'civicrm_mail_settings'                    => 'civicrm_demo_drupal.',
  'civicrm_mailing'                          => 'civicrm_demo_drupal.',
  'civicrm_mailing_bounce_pattern'           => 'civicrm_demo_drupal.',
  'civicrm_mailing_bounce_type'              => 'civicrm_demo_drupal.',
  'civicrm_mailing_component'                => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_bounce'             => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_confirm'            => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_delivered'          => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_forward'            => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_opened'             => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_queue'              => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_reply'              => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_subscribe'          => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_trackable_url_open' => 'civicrm_demo_drupal.',
  'civicrm_mailing_event_unsubscribe'        => 'civicrm_demo_drupal.',
  'civicrm_mailing_group'                    => 'civicrm_demo_drupal.',
  'civicrm_mailing_job'                      => 'civicrm_demo_drupal.',
  'civicrm_mailing_spool'                    => 'civicrm_demo_drupal.',
  'civicrm_mailing_trackable_url'            => 'civicrm_demo_drupal.',
  'civicrm_mapping'                          => 'civicrm_demo_drupal.',
  'civicrm_mapping_field'                    => 'civicrm_demo_drupal.',
  'civicrm_membership'                       => 'civicrm_demo_drupal.',
  'civicrm_membership_block'                 => 'civicrm_demo_drupal.',
  'civicrm_membership_log'                   => 'civicrm_demo_drupal.',
  'civicrm_membership_payment'               => 'civicrm_demo_drupal.',
  'civicrm_membership_status'                => 'civicrm_demo_drupal.',
  'civicrm_membership_type'                  => 'civicrm_demo_drupal.',
  'civicrm_menu'                             => 'civicrm_demo_drupal.',
  'civicrm_msg_template'                     => 'civicrm_demo_drupal.',
  'civicrm_note'                             => 'civicrm_demo_drupal.',
  'civicrm_openid'                           => 'civicrm_demo_drupal.',
  'civicrm_openid_associations'              => 'civicrm_demo_drupal.',
  'civicrm_openid_nonces'                    => 'civicrm_demo_drupal.',
  'civicrm_option_group'                     => 'civicrm_demo_drupal.',
  'civicrm_option_value'                     => 'civicrm_demo_drupal.',
  'civicrm_participant'                      => 'civicrm_demo_drupal.',
  'civicrm_participant_payment'              => 'civicrm_demo_drupal.',
  'civicrm_payment_processor'                => 'civicrm_demo_drupal.',
  'civicrm_payment_processor_type'           => 'civicrm_demo_drupal.',
  'civicrm_pcp'                              => 'civicrm_demo_drupal.',
  'civicrm_pcp_block'                        => 'civicrm_demo_drupal.',
  'civicrm_phone'                            => 'civicrm_demo_drupal.',
  'civicrm_pledge'                           => 'civicrm_demo_drupal.',
  'civicrm_pledge_block'                     => 'civicrm_demo_drupal.',
  'civicrm_pledge_payment'                   => 'civicrm_demo_drupal.',
  'civicrm_preferences'                      => 'civicrm_demo_drupal.',
  'civicrm_preferences_date'                 => 'civicrm_demo_drupal.',
  'civicrm_premiums'                         => 'civicrm_demo_drupal.',
  'civicrm_premiums_product'                 => 'civicrm_demo_drupal.',
  'civicrm_price_field'                      => 'civicrm_demo_drupal.',
  'civicrm_price_set'                        => 'civicrm_demo_drupal.',
  'civicrm_price_set_entity'                 => 'civicrm_demo_drupal.',
  'civicrm_product'                          => 'civicrm_demo_drupal.',
  'civicrm_project'                          => 'civicrm_demo_drupal.',
  'civicrm_relationship'                     => 'civicrm_demo_drupal.',
  'civicrm_relationship_type'                => 'civicrm_demo_drupal.',
  'civicrm_saved_search'                     => 'civicrm_demo_drupal.',
  'civicrm_state_province'                   => 'civicrm_demo_drupal.',
  'civicrm_subscription_history'             => 'civicrm_demo_drupal.',
  'civicrm_tag'                              => 'civicrm_demo_drupal.',
  'civicrm_task'                             => 'civicrm_demo_drupal.',
  'civicrm_task_status'                      => 'civicrm_demo_drupal.',
  'civicrm_tell_friend'                      => 'civicrm_demo_drupal.',
  'civicrm_timezone'                         => 'civicrm_demo_drupal.',
  'civicrm_uf_field'                         => 'civicrm_demo_drupal.',
  'civicrm_uf_group'                         => 'civicrm_demo_drupal.',
  'civicrm_uf_join'                          => 'civicrm_demo_drupal.',
  'civicrm_uf_match'                         => 'civicrm_demo_drupal.',
  'civicrm_value_constituent_information_1'  => 'civicrm_demo_drupal.',
  'civicrm_value_evetns_4'                   => 'civicrm_demo_drupal.',
  'civicrm_value_extending_relationship_6'   => 'civicrm_demo_drupal.',
  'civicrm_value_kay_t_2'                    => 'civicrm_demo_drupal.',
  'civicrm_value_moja_grupa_9'               => 'civicrm_demo_drupal.',
  'civicrm_value_test2_8'                    => 'civicrm_demo_drupal.',
  'civicrm_value_test_5'                     => 'civicrm_demo_drupal.',
  'civicrm_value_test_set_7'                 => 'civicrm_demo_drupal.',
  'civicrm_value_testing_3'                  => 'civicrm_demo_drupal.',
  'civicrm_worldregion'                      => 'civicrm_demo_drupal.',
);

You may delete lines with civicrm_import_job as you will not need them, replace civicrm_demo_drupal to your actual database name, and clean 'civicrm_value_*' so that they describe only your 'civicrm_value_*' tables, which will be different from demo. All other tables should be ok.

And please figure out why this text is not showing for you, as it may affect other people also...

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views & custom fields
April 13, 2009, 12:18:26 am
It's not showing because of this line - I need to re-read that wiki doc to make sense of why though.

     $config->dsn != $config->userFrameworkDSN )
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views & custom fields
April 13, 2009, 12:45:51 am
Hmm - on the local install I can see cust event field - will check some more
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Views & custom fields
April 13, 2009, 01:12:13 am
Nope, just to clarify,

There are three blocks of custom fields. One for participant, one for contact & one for event. The one for contacts was the last to be created. When I create a contact view I can see the contact fields. When I create a participant view I can see the participant fields. But when I create an event I can't see the event fields
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Re: Views & custom fields
April 13, 2009, 04:03:45 am
Check clearing Views cache (described in wiki). I've tested creating custom fields for Events on local machine, they work as fields, as filters and as argument.

Regards,
Danila

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

This forum was archived on 2017-11-26.