Hello,
I am using LoginToboggan and when a user registers and logged in via Immediate Login option, two messages appear (screenshot attached):
1) A validation e-mail has been sent to your e-mail address. In order to gain full access to the site, you will need to follow the instructions in that message.
2) Registration successful. You are now logged in.
I am wondering why the #2 appears and if it is possible to not show it? If it is a message of core drupal, should LoginToboggan be overriding it to not show it as registration is actually not successful yet as the user still needs to validate?
I hope someone will be able to help.
Thank you!
Comments
Comment #1
hunmonk commented#2 is a core message, and should never be displayed -- LT is overriding the functionality of user module for registration purposes, so user_register_submit(), the function that displays that message, should never be called.
i've check locally, and it's working properly -- so my guess is that you have another contrib module installed that's gumming up the works. disable all other contribs and see if the problem persists. if it does not, then start turning on the other contribs one at a time until you find the culprit.
Comment #2
YK85 commentedthanks! i will begin testing one module at a time to see which is causing this.
Comment #3
YK85 commentedHello,
I found that Email Registration module was causing the issue
http://drupal.org/project/email_registration
with email registration enabled:
with email registration disabled:
As I already had this post open, I was hoping to start here to see if there is something LoginToboggan can do to better integrate with Email Registration module? I would really appreciate your help!
Thank you!
EDIT: I opened #791306: Compatibility issue with LoginToboggan module in the Email Registration queue.
Comment #4
hunmonk commentedi don't put in custom hacks for other modules. looks like this should be addressed in the email registration module.
Comment #5
YK85 commentedsorry, I didn't mean to imply a custom hack to make Email Registration module work.
If you may have any idea of what might be causing this issue, your help would be awesome!
(also, the email registration module queue is pretty inactive by maintainers it seems)
Thanks for the great module!
Comment #6
YK85 commentedThe below code looks to be what is triggering this in Email Registration module.
To what code in LoginToboggan module may I point the maintainers to fix this issue?
In drupal core there is user_register_submit
Comment #7
hunmonk commentedthe extra submit handler was an attempt to fix #648450: No e-mail verification required autologin.
IMO the workflow of the email_registration module is sub-optimal, and that patch was an attempt to work around the sub-optimal workflow.
a much better fix for this whole situation is to move the logic in the hook_user 'insert' op into a form validation handler for the registration form. there you can set the value of the username in the form itself, so that the module will play more nicely with core's registration submit function -- and you can rip out the custom submit handler in the module.
while it might seem evil to manipulate form values in a validate handler, it's actually a fairly common practice in cases like this -- and it's much less evil than the current approach ;)
Comment #8
Bilmar commentedsubscribing - I was able to replicate and hoping this issue can be fixed.
I am available for any testing needed in troubleshooting.
Comment #9
Bilmar commentedI changed the title to better fit the issue and category as bug report.
#791306: Compatibility issue with LoginToboggan module looks to be a duplicate.
I hope someone will be able to help by looking at hunmonk's comment at #7 and look into a fix for this issue. Please let me know if I can help with any testing. Thank you very much.
Comment #10
rburgundy commentedAnother issue: #816572: immediate login happens even after unchecking - Forces Immediate Login when Email Registration module is enabled. Disabling Email Registration properly allows not immediately logging in the user when the option is unchecked in LoginToboggan settings.
I believe this is the code in Email Registration.
Comment #11
rjbrown99 commentedI think I can explain at least some of what is going on with logintoboggan and the submit handlers, specifically as it relates to this issue and commit: #648450: No e-mail verification required autologin.
More specifically and at least in my case, I was using the "Redirections" feature of logintoboggan, found in /admin/user/logintoboggan under the "Redirect path on Registration" header. This allowed me to redirect new users to the front page after an immediate logon instead of taking them to their profile page. In my case, I am using immediate logon and have specified in there to take users to my front page.
One of the things logintoboggan does is to replace the submit handler for the core registration function. Here's what it ends up looking like when you are using both logintoboggan and this module:
OK, so the ordering of the submit handlers goes first to logintoboggan and then to custom_email_registration. Here's what the $form_state['redirect'] looks like after logintoboggan is done, and before custom_email_registration runs:
... which in my case is correct. I want it to go to the front page. But when you look at what the above issue/patch introduced to email_registration, it runs through this if statement in the new submit handler:
... and that redirects the user to their profile, which is not what I wanted to have happen.
I have backed out to the previous -dev version of this module for now. What would you suggest in terms of fixing this? Would you care to add a module_exists for logintoboggan so that if statement isn't called when you are using that module? Or something else? I'm happy to roll a patch, just looking to agree on an approach.
Thanks and I hope that all makes sense.
Comment #12
rjbrown99 commentedComment #13
rburgundy commentedrjbrown99 - would you happen to know what hunmonk is recommending?
Comment #14
rjbrown99 commentedI understand and I'll try to explain.
There are two handlers at play here - one for validating a form before it is submitted, and then a second submit handler that is called after validation and during the submit process. There can be more than one handler for each action, so you could have 1 or more validations and one or more submits. That's how you see the array I linked above where it has two submit handlers which are called in order.
What hunmonk is suggesting is to move the code in #648450: No e-mail verification required autologin from the submit handler into a validation handler. This would mean it's called before you ever get to submit and it presents less potential for conflict with logintoboggan or other modules. If you do it at the validation level it would fail before it ever gets to a submit handler.
I don't have the problem from that issue because I am not using those features. If you aren't either, you can back out to the previous version by reviewing the commit that introduced the submit handler:
http://drupalcode.org/viewvc/drupal/contributions/modules/email_registra...
Get rid of the stuff in green and modify the stuff in yellow back to the previous version.
Comment #15
YK85 commentedHi rjbrown99,
I removed all the green highlighted code and modified the yellow back, but the user still gets logged in immediately after registering. In LoginToboggan I have the path set to /auth where there is a page with detailed instructions. When I disable Email Registration module and try again it properly redirects to /auth without logging in the user.
I've tested it 3 times where enabling Email Registration (with reverting http://drupalcode.org/viewvc/drupal/contributions/modules/email_registra...) makes user immediately login but with Email Registration disabled, it works properly and doesn't log in user and redirects to /auth
Would you happen to have any idea what may be causing this?
Thanks!
Comment #16
scotjam commentedHi yaz085
I've got the same problem. Were you able to resolve this?
cheers
scotjam
Comment #17
Balbo commented+1 following this thread...
Comment #18
YK85 commentedI unfortunately have not found a solution yet =(
Comment #19
scotjam commentedHi yaz085
Is this a potential workaround?
Use string override module to hide the message 'Registration successful. You are now logged in. '?
This is what I've done.
cheers
scotjam
Comment #20
YK85 commentedUnfortunately no bc this is also causing other issues as mentioned in #10 =(
Comment #21
dudabone commentedWell, after banging my head against the wall I was able to get a non-elegant (yet effective) solution for #10 (immediate login happens even after unchecking). after preforming the changes as descirbed in #14, you also need to remove/comment these lines:
if (!variable_get('user_email_verification', 1) && $user->uid == 0) {
$user = $account;
$user->name = $namenew;
}
$account->name = $namenew;
Comment #22
YK85 commentedThanks dudabone!
For temporary solution I commented out:
and also commented out:
I hope someone may be able to look into this for a permanent fix for Email Registration module.
Thanks
Comment #23
DanaRoseRoss commentedPLEASE IGNORE
Comment #24
DanaRoseRoss commentedChanges from #22 as a patch.
Comment #25
chuckbar77 commentedHas there been any development on improving Email Registration module to work with other modules?
Comment #26
Bilmar commented@chuckbar77 - the patch in #24 is the temporary solution
We must wait patiently for someone with programming skills to help with this problem =)
Comment #27
bleen commentedsubscribing
Comment #28
thepanz commentedI'm further investigating this issue: to me the "email_registration" could be seen as a sub-feature of LoginToboggan.. is there any interest in merging the two modules?
Comment #29
Bilmar commentedhttp://drupal.org/node/596300
Maintainer says "let me make it clear that i have no intention of merging Email Registration with LT -- it's not functionality that i am interested in supporting... :)"
Comment #30
thepanz commentedThank you for your link.. I'm not with the maintainer reply, but if it's his will ... we can't to nothing more! :(
LT maintainer also sentenced that 6.x code is in "code freeze" (besides bug-fixes) here :#979706-1: More Clean code: adding logintoboggan.admin.inc file.
I'm thinking about a *new* module with all the SignOn/LogIn features and enhancements from the two modules. They (LoginToboggan and EmailRegistration) deal with the same user-data in almost the same place, why should they reside as two separate (and fighting) modules? :)
What do you think?
Comment #31
YK85 commentedI'd definitely help with testing if a new module is introduced (especially as this module is not maintained and LT is not interested in functionality)
Comment #32
gregglesI do not think it makes sense to combine this module with login toboggan.
login toboggan is a great module for what it does, but part of why I chose and worked on this module was because login toboggan introduced some bugs while this module was relatively simple.
Comment #33
awolfey commentedI would rather see ER and LT work this out, but in the meantime I just made a simple module that undoes the conflict by unsetting the ER user registration submit function.
This eliminates ER from signing in a user a second time when using immediate login.
I'm hoping this isn't a permament problem, but in the mean time you can use this without have to hack LT or ER.
Comment #34
chuckbar77 commentedsubscribing - I hope Email Registration and Logintoboggan modules can play nice together in the future.
What about #33 as a patch into Email Registration, where it unsets when it detects Logintoboggan module enabled?
Comment #35
tfo commented+1
Would love to see a comment from the maintainer about whether the patch in #24 is relevant to his goals for the module.
Comment #36
Emmanuel.masanche commentedhelp me with this! i use logintoboggan and organic groups profile modules.
the problem is when login toboggan is in "set password " for registration.on clicking join group link ....after filling the og fields ....on submit ......the error message "you must enter a password " appears!any one with any ideas of what might b the ....... there is no password field in og profile fields!!help me!
Comment #37
bleen commentedEmmanuel, please do not change the meta data around this issue and especially do not assign it to yourself unless you plan to fix it.
Comment #38
Emmanuel.masanche commentedI understand! i didnt mean to assign it to my self!thought may be here people will help!so where shud i adress this issue? bleen18
Comment #39
rjbrown99 commented#38 this issue is specifically related to a bug in the email registration module that has to do with a submit handler. If you are having a different issue, you should open a new issue in the issue queue. Rather than a plea for help, it would be best to include as much information as is possible about the issue.
Here's the guide about how to file an issue. I suggest starting there as it may help you in obtaining support.
http://drupal.org/node/73179
Comment #40
Emmanuel.masanche commentedsorry for putting this here! i fixed it !
Comment #41
botanic_spark commentedThanks dudabone!
Solution in #21 worked for me :)
Comment #42
gregglesRegarding patch #24 -
I don't see how we can do this:
Comment #43
gregglesEmail Registration is no longer supported on 6.x-1.x. If you feel this issue is still relevant for 7.x or 8.x and is not a duplicate of another issue, please reopen it.