Skip to content

fix field names when comparing to 'pre' data

JonGold requested to merge JonGold/civirules:canonical-on-pre into master

This is very similar to !254 (merged).
Some fields have a different "canonical" and "unique" name. Contact fields have a field which is canonically named source but has a unique name of contact_source to differentiate from other source fields.

CiviRules does comparisons using the canonical names. Data passed to civicrm_post uses canonical names, so great.

But when we look up data with an API3 call, it returns unique names, and if we try to compare to one of those fields, it will return a NULL value.

In !254 (merged) we dealt with fixing API3 calls on delayed actions. In this case, we are fixing API3 calls on the pre data, which we get in part with an API3 call.

Merge request reports