Conditions can fail when additional entities are used
I'm using my new ContributionSoft
trigger, but this problem is common to any trigger that loads an additional entity via API.
CRM_Civirules_Trigger_Post::getTriggerDataFromPost()
refers to fields by their internal name. However, data retrieved via API is returned using the uniquename
for the fields. E.g. if you have a Field Value Comparison on a contact's source
field, it will be stored as, e.g., source = 4
. This works if your trigger data is populated from hook_civicrm_post
. However, if it's populated via API (as "additional" entities seem to be), the field will be named contact_source
. Additionally, the API will not return all fields by default.
I think I have a solution in mind; if I get it working I'll submit a PR.