I am using the Profile 2 module to select roles during the registration process. So a user selects a role (using a radio button) and then a rule fires to give the user the role that was selected.
Here is the rule I'm using:
{ "rules_give_user_a_role_after_registration" : {
"LABEL" : "Give user a role after registration",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "user_insert" : [] },
"IF" : [
{ "data_is" : {
"data" : [ "account:profile-main:field-user-role" ],
"value" : "Emporos"
}
}
],
"DO" : [
{ "user_add_role" : { "account" : [ "account" ], "roles" : { "value" : { "5" : "5" } } } }
]
}
}
The issue is that the role is not assigned to the user. Any idea why not?