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 Profiles (Moderator: Dave Greenberg) »
  • using civiCRM custom fields in Drupal views
Pages: [1]

Author Topic: using civiCRM custom fields in Drupal views  (Read 1918 times)

ShirleyB

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7.15
  • MySQL version: 5.5.27
  • PHP version: 5.3
using civiCRM custom fields in Drupal views
August 28, 2012, 12:35:01 am
When I add civiCRM custom fields to a Drupal view, the view returns no data.

I'm trying to construct a view showing a directory of current members of a particular type. I created a drupal 'user' type view and added fields from drupal, including this member role (I have drupal/civi sync modules installed). The view shows the relevant users/members.

Then I add fields of the type 'CiviCRM Custom: premium member profile' (my profile with the custom fields - set to search and public). As soon as any of these fields are added to the view the list of relevant users/members disappears and my view table is completely empty. I've also tried adding standard/non-custom civiCRM fields (e.g. contact fields) to my view, with the same result i.e. no results in the table. I've tried clearing all the caches and it makes no difference.

Sometimes I get the error message "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'telework_devel_drupal.civicrm_uf_match' doesn't exist"  Am I right in thinking that my problem is something to do with the msql query being unable to pick up the civiCRM fields because I need to do more with the drupal/civi sync modules? And if so what? At present I have associations between the drupal roles and the civiCRM membership types.

I'm a newbie at this and am stumped as to what to try next - any suggestions gratefully received :-) Thanks, Shirley

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: using civiCRM custom fields in Drupal views
August 28, 2012, 01:56:44 am
Have you update drupal's settings.php with proper table aliases ? Check http://drupal.demo.civicrm.org/civicrm/admin/setting/uf?reset=1

Hth
Kurund
Found this reply helpful? Support CiviCRM

ShirleyB

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7.15
  • MySQL version: 5.5.27
  • PHP version: 5.3
Re: using civiCRM custom fields in Drupal views
August 28, 2012, 02:24:58 am
Hi, I'm sorry I don't understand what that means. However, I've looked at the drupal settings.php and the civicrm.settings.php and they both seem to have the right database information in them. the demo site link seems simply to be a list of tables - they don't appear in either of my settings.php files so where would I add them?

AND connections must be being made between the databases because in my view listing just the drupal fields I can click on the username and it takes me to the profile showing my custom fields. It's only when I try to incorporate custom fields from civiCRM (which appear on the drop down list of types of fields to add) that I get no data results.

Shirley

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: using civiCRM custom fields in Drupal views
August 28, 2012, 02:36:13 am
Quote
the demo site link seems simply to be a list of tables - they don't appear in either of my settings.php files so where would I add them?

You need to add array to your settings.php. Check http://wiki.civicrm.org/confluence/display/CRMDOC40/Views3+Integration

Kurund
Found this reply helpful? Support CiviCRM

ShirleyB

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7.15
  • MySQL version: 5.5.27
  • PHP version: 5.3
Re: using civiCRM custom fields in Drupal views
August 28, 2012, 04:01:06 am
Thanks, I'll give that a try

shirley

ShirleyB

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: drupal 7.15
  • MySQL version: 5.5.27
  • PHP version: 5.3
Re: using civiCRM custom fields in Drupal views
August 28, 2012, 04:17:44 am
That worked a treat and I can now display those custom fields in the view. Thanks Kurund for taking the time to explain to a novice like me - no matter how many hours I'd worked on it I'd not have worked that out!

Shirley

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • using civiCRM custom fields in Drupal views

This forum was archived on 2017-11-26.