Action 'Set Privacy Options of a Contact' does not trigger further rules
We are using a series of different CiviRules which trigger each other, so a complex workflow is divided into smaller steps, where each rule has only one responsibility. This is great for flexibility and rule reuse. However, there's a missing link in this series where the 'Set Privacy Options of a Contact' action doesn't trigger other rules ('Contact of any type changed').
After some debugging, I've found that happens because 'Set privacy options' writes directly to database, so post hooks are not fired and no rules get triggered. After some more research, I realised that this unexpected behaviour (this is the only action that works like this) is intentional:
In that issue, main problem was with triggering other rules, is creating an infinite loop. Though a good solution was suggested in comments: using appropriate conditions to prevent infinite loops (which is important with nearly all rules), code was changed to prevent looping.
So, now I propose to revert this to the original approach.
Pros:
- same operation mode in all actions
- Civirules can be linked for a sequence of actions
- use of the API for saving data
Cons:
- it's a change for users that rely on this functionality. Though same results can be achieved by using conditions to prevent loops it needs to be adjusted in each case.