I have an rule with Create Activity set and an action to add the source contact to a group. The selector claims that the activity->source_contact_id is not a Contact type (also tried with source_contact). It only shows these valid matching types:
site:current-user:roles: User roles The roles of the user.
civicrm-activity:source-contact-id-contact:civi-user: Drupal User
civicrm-activity:source-contact-id-contact:primary-contact-id-contact: Household Primary Contact ID
civicrm-activity:source-contact-id-contact:employer-id-contact: Current Employer ID
civicrm-activity:source-contact-id-contact:civicrm-user: Drupal User Drupal User for contact
I get an error: The data type of the configured argument does not match the parameter's contact requirement.
Comments
Comment #1
eileenmcnaughton commentedIs the action to add the user to a civicrm group - as provided through the CiviCRM Rules module (not this module). I have only worked on making CiviCRM entities available to drupal actions so far.
I would probably not try to make it work with Rules but implement a civicrm-entity native set of actions (Bangpounds work may help with this)
Comment #2
eileenmcnaughton commentedActually applying this to the civicrm_rules module might make them play together - on this action. (although rules would need to be more vigourously patched potentially :-()
the inbuilt rules uses the entity 'contact' to denote 'civicrm_contact' - but I don't think that is sufficiently unique as an entity name
diff --git a/drupal/modules/civicrm_rules/civicrm_rules_action.inc b/drupal/modules/civicrm_rules/civicrm_rules_action.inc
index 26024e3..ed4a88d 100644
--- a/drupal/modules/civicrm_rules/civicrm_rules_action.inc
+++ b/drupal/modules/civicrm_rules/civicrm_rules_action.inc
@@ -61,7 +61,7 @@
}
$defaults = array(
- 'parameter' => array('contact' => array('type' => 'contact',
+ 'parameter' => array('civicrm_contact' => array('type' => 'civicrm_contact',
'label' => t('Contact'),
'save' => TRUE,
),
Comment #3
eileenmcnaughton commentedYou may find the https://github.com/eileenmcnaughton/civicrm_entity_actions module is useful for this
Comment #4
sonicthoughts commentedWow - why not merge your action module with civicrm_entity - this stuff is great!
Comment #5
eileenmcnaughton commentedThe reason I didn't merge is was that I wasn't sure this was the form I wanted entity actions to take - so I wanted to put them somewhere off-to-the-side. Mainly I'm thinking I'd rather something more generic rather than a mish-mash collection of actions - although that could be unavoidable
Comment #6
eileenmcnaughton commentedI'm closing this - at the moment I'm leaving the option to use civicrm_entity_rules rather than add to this module