Closed (fixed)
Project:
Role Signup
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Mar 2007 at 10:38 UTC
Updated:
15 Feb 2008 at 23:11 UTC
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
Comment #1
sym commentedInteresting.
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.
Comment #2
spooky69 commentedPosting to subscribe - isn't there a simpler way to subscribe?
Comment #3
fidot commentedI get this conflict even when login toboggan isn't configured to redirect to a specific page after signing up.
Comment #4
fidot commentedFurther 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
Comment #5
sym commentedfixing title
Comment #6
fidot commentedI 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
Comment #7
fidot commentedPlease 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
with
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
Comment #8
hunmonk commentedwe can't be hacking in special session vars for a single module. please provide a more general fix in unified diff format.
Comment #9
mwander commentedIs there an alternate solution?
Thank you.
Mitch
Comment #10
hunmonk commentedsure. check for existing roles in the page load, and merge in the logintoboggan changes instead of writing the roles fresh.
Comment #11
hunmonk commentedfixed 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
Comment #12
ahoria commentedThis is causing problems with me, even if I use the latest versions of rolesignup and logintoboggan.
Any clues?
Thanks a lot!
Comment #13
edex13 commentedthe 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?
Comment #14
yeeloon commentedi 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?
Comment #15
hunmonk commentedthis module needs a complete rewrite:
Comment #16
panis commentednot 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?
Comment #17
panis commentedis this the problem???
logintoboggan has:
while rolesignup has:
note 'role' vs 'roles'... and array versus a scalar
Which one should be fixed?
Comment #18
hunmonk commentedlogintoboggan 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.
Comment #19
cyberswat commentedI agree with hunmonk ... This shouldn't be a problem to fix in the refactoring.
Comment #20
cyberswat commentedThe 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.
Comment #21
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.