Make sure entityID and contactID is always set when a rule is executed
This makes sure that entityID and contactID are always set for a rule no matter how it is executed:
- Post
- Cron
- Delayed action
For example I found that "Add Tag" action did not work when a delay was added because entityID was not set when processing as a delayed action. Before this patch entityID and contactID are sometimes set, sometimes not set - it depends on the combination of triggers/conditions/actions in use because some will set them.
Merge request reports
Activity
@MikeyMJCO I found this while investigating #115 (closed)
mentioned in commit 90f5faf3
Thanks @mattwire
Thanks @mattwire we'll test and see if we can reproduce with this patch in place <3
Edited by homotechsualmentioned in issue #115 (closed)
Some entities (at least GroupContact) do not return an index 'id' for getEntityData(). In this case this line throws a notice about the undefined index:
$triggerData->setEntityId($triggerData->getEntityData($triggerData->getEntity())['id']);
I don't know if this can be a problem for following processes, that expect that entityID is set?
In case of GroupContact getEntityData returns an array with the keys 'group_id', 'contact_id' and 'status'. The 'id' of GroupContact is not provided.