Hi there....
I wanted to make a rule sending out an email when users untick a bolean single on/off tick field....
But the rule sends out 2 duplicate emails, can anyone figure out why it does that...
The rule looks like this
{ "rules_admin_change_to_basic_member" : {
"LABEL" : "Admin change to basic member",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules" ],
"ON" : [ "user_update" ],
"IF" : [
{ "data_is" : { "data" : [ "account:field-fuldt-medlemsskab" ], "value" : 0 } },
{ "NOT data_is" : { "data" : [ "account-unchanged:field-fuldt-medlemsskab" ], "value" : 0 } }
],
"DO" : [
{ "mail" : {
"to" : "[account:mail]",
"subject" : "TEST",
"message" : "TESTER",
"language" : [ "" ]
}
}
]
}
}
Comments
Comment #1
acoustika commentedWell actually figured out itøs because I have another rule acting on updating an existing user that is checking the same field..
But I can't make a component conditional ruleset, because It seems you can't use account-unchanged in the component which is kinda weird...
It seems both rules trigger as they should but the other rule I have checing the same field but does other actions also trigger this rules action a second time, and doing sm weight to the 2 rules doen't help
Comment #2
acoustika commentedWell I managed to make a work around doing some other checks....
But it seems like if several rules make a data comparisson on the same field they can trigger eachothers action..... that seems to me to be kind of a bug...
Comment #3
jkaine commentedSame exact problem.
Comment #4
jkaine commentedAnd here's the workaround I came up with:
Not necessarily an elegant solution, but quick and dirty and effective.
Comment #5
entropea commentedHaving the same issue in Rules 7.x-2.2 with Drupal 7.14.
Is there a resolution to this other than creating a monstrosity of patchwork rules?
Ideally this should be fixed in the code rather than worked around.
Can we at least get it assigned to someone to investigate?
This issue is coming up to it's first anniversary! ;)
Comment #6
ericwongcm commentedThis bug/feature still exists in the latest version of rules..
What I have done is I have created two rules that uses the same triggers and check the same conditions.
Rule 1 creates a comment entity when the specific node type is created or updated.
Rule 2 sets a data value of the node when the specific node type is created or updated.
If I have these two rules active, I will end up having two comment entity created instead of 1.
The reason I have these two rules is because the final rule for both actions will have slightly different conditions, so I can't have use a single rule.
Comment #7
kellyimagined commentedIs there a plan for this to be fixed? This issue is a big bummer.
Comment #8
arruk commentedIt seems that 6 years later there still isn't an elegant solution for this.
The proposed workarounds for this won't work in every case. Say, for example, you want an email sent to users who want updates when content changes. Any flag added to the node itself would prevent subsequent update notifications. There needs to be a mechanism build into Rules itself to identify when the triggering event was initiated by another rule and a condition to allow that event to be ignored. The lack of this filtering seems like a rather large design flaw.
Comment #9
tr commented#1704290: Improve recursion prevent to cover saves of other rules as well