drupal - Add user role based on Profile2 Field Using Rules -
what trying achieve is: 1) have profile2 field in user registration form called: "firm type" 2) need assign new user role based on selection in field.
i have tried following:
event: after saving new account condition: data comparison: account:profile-additional-registration-info:field-profile-firm-type action: add user role
the above rule works fine when remove condition. add condition rule not work. digging found out rule gets executed after account saved , before profile2 saved.
i looked online find these 2 links helpful: https://www.drupal.org/node/1872384 https://www.drupal.org/node/2009878
1 suggestion was: event: after saving new profile condition: data comparison: profile2:field action: heres problem -- cannot account level because on profile event.
could please me figure out. appreaciated! thanks!
here steps:
rules event: after adding new profile after updating existing profile
rules condition: negate user has roles: check roles other public role data comparison: profile2:field
rules action: set data value:
site:current-user:roles
Comments
Post a Comment