Add user to a role based on profile selection

Events happening in the community are now at Drupal community events on www.drupal.org.
karengrey's picture

Im trying to make two rules:

  1. add user to 'roleA' if they select 'term1' from a profile selection 'profile_type_business'
  2. add user to 'roleB' if they dont select 'term1' from a profile selection 'profile_type_business'

At the moment, i think that profile selection lists are stored as one string,
eg: term1 term2 term3 term4
and so when i create a new user and select any term, the user gets added to both roles as both conditions would return true:

return $account->profile_type_business == 'term1';
return $account->profile_type_business != 'term1';

But when looking at the user array in firebug, it displays the item selected:

$user-> [profile_type_business] => [term1]

Without changing the core functionality of profiles to not display selection lists as one string, how do i fix my problem??

Thanks!

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: