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) »
  • Seems to be a problem displaying custom fields in Drupal views
Pages: [1]

Author Topic: Seems to be a problem displaying custom fields in Drupal views  (Read 881 times)

Tony Horrocks

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 7
    • Fabriko Limited
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7
Seems to be a problem displaying custom fields in Drupal views
March 03, 2012, 11:17:11 am
This picks up the conversation on topic http://forum.civicrm.org/index.php/topic,21885.msg92463.html#msg92463

Ive got a bunch of custom field groups and Ive copied all the db stuff to settings.php

When I am adding custom fields to the view, all these custom field groups show up except the one with ID = 1.

Instead, those fields that are supposed to show up in the custom field  group show up in the contacts group.

This breaks the view because the custom fields do not belong in the contacts group. So the SQL I get is

SELECT users.uid AS uid,
   civicrm_contact.first_name AS civicrm_contact_first_name,
   civicrm_contact.id AS civicrm_contact_id,
   civicrm_contact.custom_83 AS civicrm_contact_custom_83
 FROM users users
 LEFT JOIN `lscd7_civ`.civicrm_uf_match civicrm_uf_match ON users.uid = civicrm_uf_match.uf_id
 LEFT JOIN `lscd7_civ`.civicrm_contact civicrm_contact ON civicrm_uf_match.contact_id = civicrm_contact.id
 WHERE users.uid = 28

When it should be

SELECT users.uid AS uid,
   civicrm_contact.first_name AS civicrm_contact_first_name,
   civicrm_contact.id AS civicrm_contact_id,
   civicrm_value_lsc_members_1.custom_83 AS civicrm_value_lsc_members_1_custom_83
 FROM users users
 LEFT JOIN `lscd7_civ`.civicrm_uf_match civicrm_uf_match ON users.uid = civicrm_uf_match.uf_id
 LEFT JOIN `lscd7_civ`.civicrm_contact civicrm_contact ON civicrm_uf_match.contact_id = civicrm_contact.id
 WHERE users.uid = 28

So the view breaks.

Any ideas how I can fix this?
Tony Horrocks
Author of the CiviCRM CookBook https://www.packtpub.com/web-development/civicrm-cookbook

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: Seems to be a problem displaying custom fields in Drupal views
March 03, 2012, 03:07:16 pm

can you truncate civicrm_cache and see if that fixes the issue?

really strange that its showing up as part of the contact table

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

Tony Horrocks

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 7
    • Fabriko Limited
  • CiviCRM version: 4.5.x
  • CMS version: Drupal 7
Re: Seems to be a problem displaying custom fields in Drupal views
March 04, 2012, 08:37:09 am
I optimised the table and it then appeared. Phew.
Tony Horrocks
Author of the CiviCRM CookBook https://www.packtpub.com/web-development/civicrm-cookbook

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Seems to be a problem displaying custom fields in Drupal views

This forum was archived on 2017-11-26.