We have been working on Views, with Civi Entity, on Drupal 8.

We are having an issue a list of Activities and filters. We only want to load Activities where the source contact is a particular Contextual filter (contact ID). But adding a Contextual Filter of 'CiviCRM Activity (CiviCRM Entity): Activity Source Contact' leads to an error.

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'civicrm_activity.source_contact_id' in 'where clause': SELECT civicrm_activity.id AS id FROM {civicrm_activity} civicrm_activity LEFT JOIN {civicrm_value_volunteering__9} civicrm_value_volunteering__9 ON civicrm_activity.id = civicrm_value_volunteering__9.entity_id WHERE (((civicrm_activity.activity_type_id = :civicrm_activity_activity_type_id)) AND ((civicrm_activity.source_contact_id = :civicrm_activity_source_contact_id))) AND ((civicrm_activity.is_deleted = :db_condition_placeholder_0) AND (civicrm_value_volunteering__9.validated__200 = :db_condition_placeholder_1)) LIMIT 11 OFFSET 0; Array ( [:civicrm_activity_activity_type_id] => 66 [:civicrm_activity_source_contact_id] => 20 [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => 1 )

Is that the right method for adding a contextual filter to that type of View. Or is there another way?



This is a known issue which is locked in github repo. There is a work in progress to fix the issue.

You can try applying the below patch in your d8 install to see if it resolves your problem

| improve this answer | |
  • I'm having the same problem. I tried applying the two patches and this didn't help in my case. I'm using the 8.x-3.x branch directly from the github repo. Do you have any suggestions? – Ben Sep 24 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.