Support (offered by community volunteers) > Using Drupal Modules
Civi CRM Views and Activities
co-operatives uk:
Having an odd one - set up an activity view and put a views relationship in to show the target contact id. However, instead of pulling the target_contact_id field from the civicrm_activity_target table, its just pulling through the activity id. This then means that I get the wrong contact data for the activity target. The SQL statement is below, but I can't work out which bit of the Drupal views integration code I need to be looking in to change the field name. Any ideas?
--- Code: ---SELECT civicrm_activity.id AS id, civicrm_activity.source_contact_id AS civicrm_activity_source_contact_id, civicrm_activity.activity_type_id AS civicrm_activity_activity_type_id, civicrm_contact.display_name AS civicrm_contact_display_name, civicrm_contact.id AS civicrm_contact_id, civicrm_contact_civicrm_activity_target.id AS civicrm_contact_civicrm_activity_target_id, civicrm_contact_civicrm_activity_target.display_name AS civicrm_contact_civicrm_activity_target_display_name
FROM
{civicrm_activity} civicrm_activity
LEFT JOIN {civicrm_activity_target} civicrm_activity_target ON civicrm_activity.id = civicrm_activity_target.activity_id
LEFT JOIN {civicrm_contact} civicrm_contact_civicrm_activity_target ON civicrm_activity_target.id = civicrm_contact_civicrm_activity_target.id
LEFT JOIN {civicrm_contact} civicrm_contact ON civicrm_activity.source_contact_id = civicrm_contact.id
ORDER BY civicrm_contact_civicrm_activity_target_display_name ASC
LIMIT 10 OFFSET 80
--- End code ---
Donald Lobo:
A bit tangential to your question, BUT
We are currently looking for someone to take over the maintenance and development of the views integration with civicrm module. So if anyone is interested and wants to move that further along, please contact us on IRC
lobo
co-operatives uk:
OK, found it:
sites/all/modules/civicrm/drupal/modules/views/components/civicrm.core.inc
line 1902
- 'field' => 'id',
+ 'field' => 'target_contact_id',
Will now see if it breaks anything else!
pds
tonthon:
Thanks, you saved my day :).
Note : In my case, I had to configure at new my view to get it work
ddunn:
A similar fix required for source_record_id, to display the contact who created the activity:
Line 1508 of civicrm.core.inc
- 'field' => 'id',
+ 'field' => 'source_record_id',
Navigation
[0] Message Index
[#] Next page
Go to full version