I successful used the data comparison on rules condition between saved and unchanged node for a date field.
I tried the same with a radio buttons list with two options, but the rule doesn't trigger if I change the value after saving the node.
What's wrong?
Here the rule: http://kopy.io/6GfFi and here is an instream copy of it:
{ "rules_last_day_of_work" : {
"LABEL" : "Last Day of Work",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "interval", "rules_conditional" ],
"ON" : { "node_update--job_contract" : { "bundle" : "job_contract" } },
"IF" : [
{ "NOT data_is" : {
"data" : [ "node-unchanged:field-date-of-last-day-of-work" ],
"value" : [ "node:field-date-of-last-day-of-work" ]
}
},
{ "OR" : [] },
{ "NOT data_is" : {
"data" : [ "node:field-resignation-layoff" ],
"value" : [ "node-unchanged:field-resignation-layoff" ]
}
}
],
"DO" : [
{ "drupal_message" : { "message" : "test" } },
{ "data_calc" : {
"USING" : {
"input_1" : [ "node:field-days-of-notification" ],
"op" : "*",
"input_2" : "-1"
},
"PROVIDE" : { "result" : { "days_of_notification_negative_sign" : "Days of notification with negative_sign" } }
}
},
{ "interval_apply" : {
"USING" : {
"interval" : [ "days_of_notification_negative_sign" ],
"period" : "day",
"date" : [ "node:field-date-of-last-day-of-work" ]
},
"PROVIDE" : { "date" : { "notification_date" : "Notification Date" } }
}
},
{ "CONDITIONAL" : [
{
"IF" : { "text_matches" : {
"text" : [ "node:field-resignation-layoff" ],
"match" : "L",
"operation" : "starts"
}
},
"DO" : [
{ "data_set" : {
"data" : [ "node:field-layoff-date" ],
"value" : [ "notification-date" ]
}
},
{ "data_set" : { "data" : [ "node:field-resignation-date" ] } }
]
},
{ "ELSE" : [
{ "data_set" : {
"data" : [ "node:field-resignation-date" ],
"value" : [ "notification-date" ]
}
},
{ "data_set" : { "data" : [ "node:field-layoff-date" ] } }
]
}
]
},
{ "redirect" : { "url" : "[node:url]" } }
]
} }
THE ANSWER IS:
this is the way to put two condition in "OR"
and NOT this one: