Currently I have a rules as follows:
{ "rules_update_mitarbeiterzahl_von_firma" : {
"LABEL" : "Update Mitarbeiterzahl von Firma",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "Contacts" ],
"REQUIRES" : [ "rules", "rules_conditional" ],
"ON" : { "node_update--contact" : { "bundle" : "contact" } },
"IF" : [
{ "entity_has_field" : { "entity" : [ "node" ], "field" : "field_firmen" } },
{ "NOT data_is_empty" : { "data" : [ "node:field-firmen" ] } }
],
"DO" : [
{ "LOOP" : {
"USING" : { "list" : [ "node:field-firmen" ] },
"ITEM" : { "firma_der_person" : "Firma der Person" },
"DO" : [
{ "CONDITIONAL" : [
{
"IF" : { "entity_has_field" : { "entity" : [ "firma-der-person" ], "field" : "field_mitarbeiterzahl" } },
"DO" : [
{ "variable_add" : {
"USING" : {
"type" : "integer",
"value" : [ "firma-der-person:field-mitarbeiterzahl" ]
},
"PROVIDE" : { "variable_added" : { "aktuelle_mitarbeiteranzahl" : "Aktuelle Mitarbeiteranzahl" } }
}
},
{ "data_calc" : {
"USING" : {
"input_1" : [ "aktuelle-mitarbeiteranzahl" ],
"op" : "+",
"input_2" : "1"
},
"PROVIDE" : { "result" : { "neue_ma_anzahl" : "Neue Mitarbeiter Anzahl" } }
}
},
{ "drupal_message" : { "message" : "TEST [neue-ma-anzahl:value]" } }
]
}
]
}
]
}
}
]
}
}
Also see the image attached.
No matter wether I calculate a value or just set want to show the value of neue-ma-anzahl in a message with a token, this token will always be empty. Outside if a if condition this works in rules. May this be a bug in this awesome module?
Comment | File | Size | Author |
---|---|---|---|
#1 | rule-conditional.png | 22.5 KB | manuelBS |
Comments
Comment #1
manuelBS CreditAttribution: manuelBS commentedComment #2
Yuri CreditAttribution: Yuri commentedI confirm this bug, and have a similar use case.
Comment #3
Yuri CreditAttribution: Yuri commentedComment #4
nanabrownee CreditAttribution: nanabrownee commentedHas anyone found a way around this?
Comment #5
Yuri CreditAttribution: Yuri commented"Set data value" also not working inside a conditional section.
Comment #6
Yuri CreditAttribution: Yuri commentedStill nobody responding, while this quite an important issue.
Comment #7
oturpin CreditAttribution: oturpin commentedHi all,
Same issue with Rules 2.9. I have defined and calculated a rules variable. But, cannot use it in af "if" statement.
Is this a bug ? or a normal limitation ?
Thx