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) »
  • Help with Views for Display of Custom Data
Pages: [1]

Author Topic: Help with Views for Display of Custom Data  (Read 1715 times)

mcloud001

  • Guest
Help with Views for Display of Custom Data
April 17, 2010, 08:26:21 am
Hi
I would like some help with how to use views to Display Custom Data.  As preparation I read the Wiki and carried out the recommended setup for both my database and my drupal settings file.  As part of this setup I setup my Druapl MySQL user with SELECT permissions.

I am using:
Drupal 6.16
PHP 5.2.10
MySQL 5.0.84
CiviCRM 3.13

I then setup a new view choosing the option to select my Custom Fields.

However when I go to display the fields I get the titles but no data.  There is data to display as I can edit the data through the Drupal facility to Edit Users.

Any help much apreciated

Below is the content I added to my Settings File:
/*
Settings required to allow Drupal Views module to access CiviCRM data
*/
$db_prefix = array(
  'civicrm_acl'                              => 'iftcivicrm.',
  'civicrm_acl_cache'                        => 'iftcivicrm.',
  'civicrm_acl_contact_cache'                => 'iftcivicrm.',
  'civicrm_acl_entity_role'                  => 'iftcivicrm.',
  'civicrm_activity'                         => 'iftcivicrm.',
  'civicrm_activity_assignment'              => 'iftcivicrm.',
  'civicrm_activity_target'                  => 'iftcivicrm.',
  'civicrm_address'                          => 'iftcivicrm.',
  'civicrm_cache'                            => 'iftcivicrm.',
  'civicrm_case'                             => 'iftcivicrm.',
  'civicrm_case_activity'                    => 'iftcivicrm.',
  'civicrm_case_contact'                     => 'iftcivicrm.',
  'civicrm_component'                        => 'iftcivicrm.',
  'civicrm_contact'                          => 'iftcivicrm.',
  'civicrm_contact_type'                     => 'iftcivicrm.',
  'civicrm_contribution'                     => 'iftcivicrm.',
  'civicrm_contribution_page'                => 'iftcivicrm.',
  'civicrm_contribution_product'             => 'iftcivicrm.',
  'civicrm_contribution_recur'               => 'iftcivicrm.',
  'civicrm_contribution_soft'                => 'iftcivicrm.',
  'civicrm_contribution_type'                => 'iftcivicrm.',
  'civicrm_contribution_widget'              => 'iftcivicrm.',
  'civicrm_country'                          => 'iftcivicrm.',
  'civicrm_county'                           => 'iftcivicrm.',
  'civicrm_currency'                         => 'iftcivicrm.',
  'civicrm_custom_field'                     => 'iftcivicrm.',
  'civicrm_custom_group'                     => 'iftcivicrm.',
  'civicrm_dashboard'                        => 'iftcivicrm.',
  'civicrm_dashboard_contact'                => 'iftcivicrm.',
  'civicrm_dedupe_rule'                      => 'iftcivicrm.',
  'civicrm_dedupe_rule_group'                => 'iftcivicrm.',
  'civicrm_discount'                         => 'iftcivicrm.',
  'civicrm_domain'                           => 'iftcivicrm.',
  'civicrm_email'                            => 'iftcivicrm.',
  'civicrm_entity_file'                      => 'iftcivicrm.',
  'civicrm_entity_tag'                       => 'iftcivicrm.',
  'civicrm_event'                            => 'iftcivicrm.',
  'civicrm_file'                             => 'iftcivicrm.',
  'civicrm_financial_trxn'                   => 'iftcivicrm.',
  'civicrm_grant'                            => 'iftcivicrm.',
  'civicrm_group'                            => 'iftcivicrm.',
  'civicrm_group_contact'                    => 'iftcivicrm.',
  'civicrm_group_contact_cache'              => 'iftcivicrm.',
  'civicrm_group_nesting'                    => 'iftcivicrm.',
  'civicrm_group_organization'               => 'iftcivicrm.',
  'civicrm_im'                               => 'iftcivicrm.',
  'civicrm_line_item'                        => 'iftcivicrm.',
  'civicrm_loc_block'                        => 'iftcivicrm.',
  'civicrm_location_type'                    => 'iftcivicrm.',
  'civicrm_log'                              => 'iftcivicrm.',
  'civicrm_mail_settings'                    => 'iftcivicrm.',
  'civicrm_mailing'                          => 'iftcivicrm.',
  'civicrm_mailing_bounce_pattern'           => 'iftcivicrm.',
  'civicrm_mailing_bounce_type'              => 'iftcivicrm.',
  'civicrm_mailing_component'                => 'iftcivicrm.',
  'civicrm_mailing_event_bounce'             => 'iftcivicrm.',
  'civicrm_mailing_event_confirm'            => 'iftcivicrm.',
  'civicrm_mailing_event_delivered'          => 'iftcivicrm.',
  'civicrm_mailing_event_forward'            => 'iftcivicrm.',
  'civicrm_mailing_event_opened'             => 'iftcivicrm.',
  'civicrm_mailing_event_queue'              => 'iftcivicrm.',
  'civicrm_mailing_event_reply'              => 'iftcivicrm.',
  'civicrm_mailing_event_subscribe'          => 'iftcivicrm.',
  'civicrm_mailing_event_trackable_url_open' => 'iftcivicrm.',
  'civicrm_mailing_event_unsubscribe'        => 'iftcivicrm.',
  'civicrm_mailing_group'                    => 'iftcivicrm.',
  'civicrm_mailing_job'                      => 'iftcivicrm.',
  'civicrm_mailing_spool'                    => 'iftcivicrm.',
  'civicrm_mailing_trackable_url'            => 'iftcivicrm.',
  'civicrm_mapping'                          => 'iftcivicrm.',
  'civicrm_mapping_field'                    => 'iftcivicrm.',
  'civicrm_membership'                       => 'iftcivicrm.',
  'civicrm_membership_block'                 => 'iftcivicrm.',
  'civicrm_membership_log'                   => 'iftcivicrm.',
  'civicrm_membership_payment'               => 'iftcivicrm.',
  'civicrm_membership_status'                => 'iftcivicrm.',
  'civicrm_membership_type'                  => 'iftcivicrm.',
  'civicrm_menu'                             => 'iftcivicrm.',
  'civicrm_msg_template'                     => 'iftcivicrm.',
  'civicrm_navigation'                       => 'iftcivicrm.',
  'civicrm_note'                             => 'iftcivicrm.',
  'civicrm_openid'                           => 'iftcivicrm.',
  'civicrm_openid_associations'              => 'iftcivicrm.',
  'civicrm_openid_nonces'                    => 'iftcivicrm.',
  'civicrm_option_group'                     => 'iftcivicrm.',
  'civicrm_option_value'                     => 'iftcivicrm.',
  'civicrm_participant'                      => 'iftcivicrm.',
  'civicrm_participant_payment'              => 'iftcivicrm.',
  'civicrm_participant_status_type'          => 'iftcivicrm.',
  'civicrm_payment_processor'                => 'iftcivicrm.',
  'civicrm_payment_processor_type'           => 'iftcivicrm.',
  'civicrm_pcp'                              => 'iftcivicrm.',
  'civicrm_pcp_block'                        => 'iftcivicrm.',
  'civicrm_phone'                            => 'iftcivicrm.',
  'civicrm_pledge'                           => 'iftcivicrm.',
  'civicrm_pledge_block'                     => 'iftcivicrm.',
  'civicrm_pledge_payment'                   => 'iftcivicrm.',
  'civicrm_preferences'                      => 'iftcivicrm.',
  'civicrm_preferences_date'                 => 'iftcivicrm.',
  'civicrm_premiums'                         => 'iftcivicrm.',
  'civicrm_premiums_product'                 => 'iftcivicrm.',
  'civicrm_price_field'                      => 'iftcivicrm.',
  'civicrm_price_set'                        => 'iftcivicrm.',
  'civicrm_price_set_entity'                 => 'iftcivicrm.',
  'civicrm_product'                          => 'iftcivicrm.',
  'civicrm_project'                          => 'iftcivicrm.',
  'civicrm_relationship'                     => 'iftcivicrm.',
  'civicrm_relationship_type'                => 'iftcivicrm.',
  'civicrm_report_instance'                  => 'iftcivicrm.',
  'civicrm_saved_search'                     => 'iftcivicrm.',
  'civicrm_state_province'                   => 'iftcivicrm.',
  'civicrm_subscription_history'             => 'iftcivicrm.',
  'civicrm_tag'                              => 'iftcivicrm.',
  'civicrm_task'                             => 'iftcivicrm.',
  'civicrm_task_status'                      => 'iftcivicrm.',
  'civicrm_tell_friend'                      => 'iftcivicrm.',
  'civicrm_timezone'                         => 'iftcivicrm.',
  'civicrm_uf_field'                         => 'iftcivicrm.',
  'civicrm_uf_group'                         => 'iftcivicrm.',
  'civicrm_uf_join'                          => 'iftcivicrm.',
  'civicrm_uf_match'                         => 'iftcivicrm.',
  'civicrm_value_constituent_information_1'  => 'iftcivicrm.',
  'civicrm_value_membership_information_3'   => 'iftcivicrm.',
  'civicrm_value_membership_type_2'          => 'iftcivicrm.',
  'civicrm_worldregion'                      => 'iftcivicrm.',
);

datakid

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 0
Re: Help with Views for Display of Custom Data
April 19, 2010, 05:37:25 pm
Out of interest, if your custom data only applies to a subtype of your data set (in my case it was Activities, but only phone calls, not "ANY", which includes *all* Activity types) then this is a known problem.

The answer is to comment out line 328 of

sites/all/modules/civicrm/CRM/Core/BAO/CustomGroup.php

The line in question looks like:

   328             $subType  = CRM_Core_DAO::VALUE_SEPARATOR . $subType . CRM_Core_DAO::VALUE_SEPARATOR;

like such:

   328             //$subType  = CRM_Core_DAO::VALUE_SEPARATOR . $subType . CRM_Core_DAO::VALUE_SEPARATOR;

There is more about it (well, me stumbling through the code trying to find an answer) here:
http://forum.civicrm.org/index.php?topic=13152

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Help with Views for Display of Custom Data
April 20, 2010, 04:34:11 am
Can you post the SQL that the view is using? You can see this at the bottom of the page if you edit the view and click the Preview button.
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.

mcloud001

  • Guest
Re: Help with Views for Display of Custom Data
April 24, 2010, 04:22:04 am
Datakid
Thanks for the pointer, I have done this and will read through the link you posted.  Thanks again

mcloud001

  • Guest
Re: Help with Views for Display of Custom Data
April 24, 2010, 04:23:50 am
Hershel
No problem, here is the SQL and thanks  :)
SELECT civicrm_contact.id AS id,
   civicrm_value_membership_information_3.banking_references_27 AS civicrm_value_membership_information_3_banking_references_27,
   civicrm_value_membership_information_3.company_name_21 AS civicrm_value_membership_information_3_company_name_21,
   civicrm_value_membership_information_3.company_ownership_17 AS civicrm_value_membership_information_3_company_ownership_17,
   civicrm_value_membership_information_3.experience_25 AS civicrm_value_membership_information_3_experience_25,
   civicrm_value_membership_information_3.location_16 AS civicrm_value_membership_information_3_location_16,
   civicrm_value_membership_information_3.membership_type_12 AS civicrm_value_membership_information_3_membership_type_12,
   civicrm_value_membership_information_3.news_alerts_24 AS civicrm_value_membership_information_3_news_alerts_24,
   civicrm_value_membership_information_3.preferred_role_19 AS civicrm_value_membership_information_3_preferred_role_19,
   civicrm_value_membership_information_3.roles_in_last_3_years_26 AS civicrm_value_membership_information_3_roles_in_last_3_years_26,
   civicrm_value_membership_information_3.sector_experience_15 AS civicrm_value_membership_information_3_sector_experience_15,
   civicrm_value_membership_information_3.turnover_18 AS civicrm_value_membership_information_3_turnover_18
 FROM iftcivicrm.civicrm_contact civicrm_contact
 LEFT JOIN iftcivicrm.civicrm_value_membership_information_3 civicrm_value_membership_information_3 ON civicrm_contact.id = civicrm_value_membership_information_3.entity_id
    ORDER BY civicrm_value_membership_information_3_location_16 ASC, civicrm_value_membership_information_3_experience_25 ASC, civicrm_value_membership_information_3_banking_references_27 ASC, civicrm_value_membership_information_3_company_name_21 ASC, civicrm_value_membership_information_3_company_ownership_17 ASC, civicrm_value_membership_information_3_membership_type_12 ASC, civicrm_value_membership_information_3_news_alerts_24 ASC, civicrm_value_membership_information_3_preferred_role_19 ASC, civicrm_value_membership_information_3_roles_in_last_3_years_26 ASC, civicrm_value_membership_information_3_sector_experience_15 ASC, civicrm_value_membership_information_3_turnover_18 ASC

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Help with Views for Display of Custom Data
April 24, 2010, 12:56:26 pm
SQL seems correct. Can you run it directly against the database (via phpMyAdmin perhaps) and see the results? Does your data appear correct there?
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Help with Views for Display of Custom Data
April 24, 2010, 04:53:16 pm
Your database is definitely iftcivicrm?

You should have a 'default' in that array to indicate what the drupal tables are prefixed by.
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

mcloud001

  • Guest
Re: Help with Views for Display of Custom Data
April 25, 2010, 11:06:59 am
Hi Hershel
I have run the SQL statement and most of the rows are empty, Although initially I was surprised by this I have looked into the datas and it is becuase I loaded sample data when I installed CiviCRM.  Row 103 does return valid data.  My view was set to display only 10 rows which explains the problem DUH!  Thanks for the help - checking the database helped my see the obvious - now I need to set it so that I only see the details for my logged in user and not all users.  Once again thanks.  :)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Help with Views for Display of Custom Data
April 25, 2010, 11:08:56 am
My pleasure.
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.

mcloud001

  • Guest
Re: Help with Views for Display of Custom Data
April 25, 2010, 11:09:10 am
Hi Eileen
Yes it is, as you can see from my post above there was a problem with the oganic interface - ME!  On to the next step of only seeing the data for my logged in user.  Thanks for your help.  :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Help with Views for Display of Custom Data

This forum was archived on 2017-11-26.