I am trying to redirect any user with a particular Role at login to a URL. I am using Backdrop (Drupal 7). I have looked at most of the posts relating to this problem, and tried many of the examples but the redirect fails. There are no messages in the Logs, I have debugging on in Rules. I have tried this which is from a post I found, and modified for my page redirection which works:
{ "rules_after_login_redirect_to_host_registration" : {
"LABEL" : "After login redirect to Host Registration.",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "user_login" : [] },
"IF" : [
{ "NOT text_matches" : {
"text" : [ "site:current-page:path" ],
"match" : "^user\/reset\/",
"operation" : "regex"
}
}
],
"DO" : [
{ "redirect" : { "url" : "webform\/host-registration" } },
{ "backdrop_message" : { "message" : "Redirecting to Host Registration" } } ]
}
}
However my Rule to Redirect a user at login with a Role of Host does not work:
{ "rules_redirect_role_host_to_selected_page" : {
"LABEL" : "Redirect role Host to selected page",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "user_login" : [] },
"IF" : [
{ "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "host" : "host" } } } }
],
"DO" : [ { "redirect" : { "url" : "webform\/host-registration" } } ]
}
}
I am baffled. Why is the Role Condition not picked up?