- Issue created by @nubeli
- 🇳🇿New Zealand petednz
related to https://www.drupal.org/project/civicrm_entity/issues/3305458 🐛 Activity cannot be filtered on Assignee in Views Active
When adding some relationships or filters of related contacts, it results in an error like this:
Column not found: 1054 Unknown column 'civicrm_activity.assignee_contact_id' in 'on clause': SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "civicrm_activity" "civicrm_activity" LEFT JOIN civi.civicrm_activity_contact "civicrm_activity_contact" ON civicrm_activity.id = civicrm_activity_contact.activity_id AND civicrm_activity_contact.record_type_id = :views_join_condition_0 LEFT JOIN civi.civicrm_contact "civicrm_contact_civicrm_activity_contact" ON civicrm_activity_contact.contact_id = civicrm_contact_civicrm_activity_contact.id LEFT JOIN civi.civicrm_contact "civicrm_contact_civicrm_activity" ON civicrm_activity.assignee_contact_id = civicrm_contact_civicrm_activity.id WHERE ((civicrm_activity.status_id = :civicrm_activity_status_id)) AND ((civicrm_activity.activity_type_id = :civicrm_activity_activity_type_id))) "subquery"; Array ( [:civicrm_activity_status_id] => 1 [:civicrm_activity_activity_type_id] => 58 [:views_join_condition_0] => 2 )
Also for other activity contacts: "Unknown column 'civicrm_activity.target_contact_id'"
1. Create a view with "CiviCRM Activity" as base table.
2. Add relationship: "Contact(s) assigned to this activity". (or "Contact(s) participating in this activity".)
3. Or, add filter: "Activity Assignee".
Note that using the relationship "Contact(s) assigned to this activity." does work. This one has an additional option for choosing "Source", "Target", "Assignee".
Somehow fix it.
Active
4.0
Code
related to https://www.drupal.org/project/civicrm_entity/issues/3305458 🐛 Activity cannot be filtered on Assignee in Views Active