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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • drupal views + custom data
Pages: [1]

Author Topic: drupal views + custom data  (Read 1075 times)

rob1263

  • Guest
drupal views + custom data
August 08, 2010, 10:28:32 am
In civi's drupal views implementation (3.2.0), it seems
that it isn't possible to make a view that includes both
Individual custom data and Membership custom data.
E.g., you can create a Contacts view that shows Individual
custom data and core Membership data, but Membership
custom fields aren't available in the field select.

Attached is a patch to make all custom data available in
both Contacts and User views in drupal.

It's only barely tested with Membership custom data, but
it seems to work. I'm not sure if it should be limited
to just some types of custom data (Memberships + ...?) ?

I'm also wondering if it wouldn't be better to use
views "relationships" rather than joins (but joins is
is the strategy the current implementation is using).

Is this the right place to post things like this? :)

Thanks.

- Rob

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: drupal views + custom data
August 08, 2010, 08:09:11 pm

seems like you are joining ALL custom tables directly to civicrm contact which is not right for ALL custom tables that do not extend Contact / Indiv / HH / Org, since in those cases entity_id is an FK to civicrm_membership / civicrm_participant etc ...

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

rob1263

  • Guest
Re: drupal views + custom data
August 08, 2010, 09:21:37 pm
It's two steps:

1. join custom data to parent entity (the original code).
2. also join to contacts via the parent entity (which only works if
the parent entity table is already joined to civicrm_contact,
as it is for civicrm_membership, and I assumed others).

Sounds like I should limit the second join to memberships
and maybe contributions (both of which have a  'contact_id'
field in the entity table) ?


rob1263

  • Guest
Re: drupal views + custom data
August 12, 2010, 08:50:04 am
Attached is another version that joins just
membership and contribution custom data to contacts
and user views...

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • drupal views + custom data

This forum was archived on 2017-11-26.