Posted by adnanshareef on March 20, 2007 at 10:38am
Jump to:
| Project: | Role Signup |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | cyberswat |
| Status: | closed (fixed) |
Issue Summary
The module does not assign the selected role to a newly registered user upon registration IF login toboggan module exists and is configured to redirect to a specific page after signing up.
thanks
Comments
#1
Interesting.
Do you think this is a problem with role signup or Login Toboggan? I would have thought that Login Toboggan should process all the custom _submit hooks before redirecting.
I'd be intersted in some more feedback from them.
#2
Posting to subscribe - isn't there a simpler way to subscribe?
#3
I get this conflict even when login toboggan isn't configured to redirect to a specific page after signing up.
#4
Further investigation shows that it is the LoginToboggan option of "Use two e-mail fields on registration form" that causes the Role Signup module to not work. By not work, I mean that no entry is written to the users_roles table, meaning that the new user is not assigned any role at all.
I am using the Login Destination module to redirect, so it is not the redirecting within Login Toboggan that is causing the problem. I changed each of its other configuration options, one at a time, and narrowed the problem down to the "two e-mail fields on registration".
Hope this helps someone narrow the problem down.
Terry
#5
fixing title
#6
I have traced the problem to line 211 in user.module
Changing
if (is_array($array['roles'])) {toif ($array['roles']) {seems to do the trick.
However, I don't understand why this problem only manifests itself when the logintoboggan "two email option" is selected and I am not sure of any side effects of this change.
Should I report this in user.module too?
Terry
#7
Please ignore my previous comment. The "real" issue is in line 255 of the logintoboggan module, as it assumes that any role set at this stage must be wrong, so an empty array needs to be passed to function user_save in the user module.
Replacing
$roles = ($reg_pass_set && ($validating_id > 2)) ? array($validating_id => 1) : array();with
$roles = ($reg_pass_set && ($validating_id > 2)) ? array($validating_id => 1) : array($_SESSION['role'] => 1);works for me. Given that $_SESSION['role'] is only defined by the rolesignup module (is that true?), the above change shouldn't have any side effects.
HTH
Terry
#8
we can't be hacking in special session vars for a single module. please provide a more general fix in unified diff format.
#9
Is there an alternate solution?
Thank you.
Mitch
#10
sure. check for existing roles in the page load, and merge in the logintoboggan changes instead of writing the roles fresh.
#11
fixed for 4.7: http://drupal.org/cvs?commit=75719
fixed for 5: http://drupal.org/cvs?commit=75717
see the commits for details on the fix. moving this issue to role signup module, as it really shouldn't be using SESSION vars to add roles on form submissions
#12
This is causing problems with me, even if I use the latest versions of rolesignup and logintoboggan.
Any clues?
Thanks a lot!
#13
the dev version of logintoboggan is already patch (http://drupal.org/node/129411#comment-281608)
i still having problem with the role signup. below are the version of modules and date that i use.
logintoboggan 5.x-1.x-dev 2007-Oct-11
Role signup5.x-1.x-dev 2007-Jun-19
any update from developer?
#14
i got the same problem as edex13.
running:
logintoboggan 5.x-1.x-dev 2007-Oct-11
Role signup5.x-1.x-dev 2007-Jun-19
any updates?
#15
this module needs a complete rewrite:
#16
not sure there is a clean way to do that - because the current model integrates with the nodeprofile module.
The nodeprofile module has functionality to display the user profile node in the registration form itself.
But it is able to do so only if it knows coming into the registration form as to what role the user has.
Selecting the role within the registration form would mean having the profile information filled out in a second step - which may be functionality that some of us would like to avoid.
Any ideas?
#17
is this the problem???
logintoboggan has:
isset($form_values['roles']) ? array_filter($form_values['roles']) : array(); ....while rolesignup has:
$form['role'] = array('#type' => 'value',
'#value' => $_SESSION['role'],
);
note 'role' vs 'roles'... and array versus a scalar
Which one should be fixed?
#18
logintoboggan uses core's $user->roles array, and i will not change that. i think rolesignup needs to find a more standard way to track it's information.
#19
I agree with hunmonk ... This shouldn't be a problem to fix in the refactoring.
#20
The rolesignup module has been rewritten to use Drupal properly. The hacks that were in place to create this problem in the first place are no longer there. Please evaluate the dev snapshot of http://drupal.org/project/autoassignrole as I believe it fixes this.
#21
Automatically closed -- issue fixed for two weeks with no activity.