I have two roles - user and seller. Each role has it's own profile2 profile, as sellers are required to provide full contact details, but users are not.

Using a selector in the main-profile, I want users to be able to self select their role

I have this working with the Rules module - sort of. But the problem that, the first time the selector is changed the rule does not seem to trigger, the selector has to be reversed and fired a second time before the rule works.

Once working, user can switch roles back and forth without difficulty. But what is causing the initial misfire?

The rule is as follows:-
Event: After updating an existing profile
Elements: Data comparison/ site:current-user:profile-main:field-activate-seller-profile (yes or no)
Actions: Add user role / Parameter: User: [site:current-user], Roles: seller

I wondering about the distinction between 'saving a new profile' and 'updating an existing profile' ???

Comments

mitchell’s picture

Project: Rules » Profile2
Version: 7.x-2.0 »
Component: Documentation » Code
mrpauldriver’s picture

This issue was recently moved here.

Is anybody able to help me with this?

mrpauldriver’s picture

Issue summary: View changes

clarified question

kenorb’s picture

Project: Profile2 » Profile 2
Version: » 7.x-1.x-dev
Issue summary: View changes