Workflow-ng cannot add roles to a new user on the user registration event.
The Wng event for user registration is invoked through Wng's implementation of hook_user. However, changes to the user are not returned from this function (passed back to the function invoking hook_user through arguments); rather they are made through Wng's action functions.
If you configure an add role action for the user registration event, then this event triggers the add role action, which adds roles to the supplied user object and then saves it using user_save. However, after Wng's hook_user function returns to user_save (from the user's registration), all roles for the user are deleted and overwritten (see user_save: 'Save user roles (delete just to be safe)' comes after user_module_invoke).
It seems to me there are two possible solutions:
-- Change Wng so that it returns through hook_user's argument the modifications made to the user object through actions (or at least through the add role action).
-- Change core user module so that it does not delete roles after doing user_module_invoke('insert').
Comments
Comment #1
fagoindeed, I fixed that bug already for rules and backported the fix. Please test if it works right with the next generated dev snapshot.