While user accepted invitation it shows:

Notice: Undefined variable: mailkey in logintoboggan_user_register_submit() (line 525 of /usr/home/......../sites/all/modules/logintoboggan/logintoboggan.module).
Notice: Undefined variable: text in _user_mail_text() (line 2742 of /usr/home/........./modules/user/user.module).
Notice: Undefined variable: text in _user_mail_text() (line 2742 of /usr/home/........../modules/user/user.module).

And user gets empty confirmation

Comments

glekli’s picture

Thanks for reporting. Did you validate that it is Invite that causes this error? Does this stop appearing when you disable Invite?

Dimetrius’s picture

Yes, I tested it
It depends if invite activated or not, and issue happens when new user registers under invite link

Jessica A’s picture

I have the same error

TimelessDomain’s picture

I don't think this error is from invite, since i do not have this installed.

using
- profile2
- realname
- profile2 registration path
- logintoboggan

vankod’s picture

Same problem.

vankod’s picture

Priority: Major » Critical

This problem actual only if radiobutton "Invitees only" checked in "Who can register accounts?" section on http://mysite.any/admin/config/people/accounts page. It's activate, when site need to send "welcome message".

I'm not shure that it is LoginToboggan problem.

onefang’s picture

I can confirm this. Turn off "Invitees only" and there's no errors, with the validation email being properly filled instead of empty. With "Invitees only" turned on, the user gets the errors mentioned above when they accept the invite, and the validation email sent as the next step is blank.

klucid’s picture

I can confirm that it is a LoginToboggan issue. I just disabled the module and left the invitee only option activated. User registers with no problem.

onefang’s picture

So the problem only happens when BOTH are turned on. The two modules don't get along. Should stop pointing the finger and try to get along. Could be that both are at fault.

burgs’s picture

Project: Invite » LoginToboggan
Version: 7.x-2.1-beta2 » 7.x-1.3

The issue is with LoginToboggan. In logintoboggan.module line 511 there is the presumption that no modules will alter the user settings form. It expects variable_get('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL) to be either USER_REGISTER_VISITORS or USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL and fails to initialize $mailkey if there is another value set for the user_register variable.

I think the following code needs to be in place at around line 525

  if($mailkey) {
    // Mail the user.
    _user_mail_notify($mailkey, $account);

    drupal_set_message($message);
  }
klucid’s picture

Thanks, Burgs. Have you had a chance to try this out?

awgh’s picture

Burgs has it almost 100% there, but my site is Invite-only with no admin confirmation required, so $mailkey is not even defined. To avoid an undefined variable error, the patch should use isset() instead of the C-style if($mailkey).

Not to take anything away from Burgs, the original patch saved me a really large amount of time during a busy week! Thank you Burgs!

Corrected fix below works awesome for me (logintoboggan.module around line 525):

<?php
  if(isset($mailkey)) {
    // Mail the user.
    _user_mail_notify($mailkey, $account);

    drupal_set_message($message);
  }
?>
burgs’s picture

Thanks awgh,

If you want to create a patch from your changes, I will review them, and we can get it committed.

puddyglum’s picture

Status: Active » Needs review
StatusFileSize
new657 bytes

The drupal_set_message($message); can be moved outside the if statement, as it is set with a default value.

Attached a patch from #12 with the modification.

puddyglum’s picture

Yeah, so this is more complicated now. I saw it as a nicety that we could leave the site in "Invite Only" mode, and yet the Profile2 Registration Path module allows users to register even in "Invite Only" mode...

I think this problem really is a result of Registration Path not correctly handling the site-wide registration settings, or providing a workaround for it.

So even with this patch applied, I don't get an e-mail.

Taxoman’s picture

Title: Doesn't work correctly with LoginToboggan 7.x-1.x » LT and Invites module conflict when 'Invitees only' setting is used
Version: 7.x-1.3 » 7.x-1.x-dev
astutonet’s picture

Hi.

I also have this issue.

I did a test by applying the patch in #14. The error message is no longer displayed. It's possible to view an e-mail confirmation message, but the e-mail with additional information is not sent.

I also did a test with the code provided in #12. The message of e-mail confirmation wasn't displayed, but an email was sent to the mailbox of the new user with a new link.

This new link, relates only to options for sending messages.

For the system to work, it was necessary to enable the option "Set password" in admin page of LoginToboggan.

After that, the guest user can access the site via the link in the confirmation email and enter your password to log in to the site.

I think this is the way temporarily.

Road Kill’s picture

•Notice: Undefined variable: mailkey in logintoboggan_user_register_submit() (line 524 of /usr/www/users/shonghjazq/sites/all/modules/logintoboggan/logintoboggan.module).
•Notice: Undefined variable: text in _user_mail_text() (line 2770 of /usr/www/users/shonghjazq/modules/user/user.module).
•Notice: Undefined variable: text in _user_mail_text() (line 2770 of /usr/www/users/shonghjazq/modules/user/user.module).
•Unable to send e-mail. Contact the site administrator if the problem persists.

I have also encountered this problem but only after upgrading the core to 7.19. I have also tried the patch #14 on the 7.x-1.x-dev version which removes the error message but the email is then not being sent.

I also do not have the Invites module installed so this problem must be with Login Toboggan.

I have tried the #12 fix but I get the following error with no mails being sent.

Notice: Undefined variable: mailkey in logintoboggan_user_register_submit() (line 525 of /usr/www/users/shonghjazq/sites/all/modules/logintoboggan/logintoboggan.module).

szt’s picture

Confirm the bug.
I don't use Invite.
Maybe this is a conflict with the Profile2 module.
Same environment with #4.
With patch #14 there is no error message, but also no mail at all.

szt’s picture

Status: Needs review » Needs work
Road Kill’s picture

Hi Szt I can confirm that I am also using the Profile2 module and I think the problem coul aslo be Profile2 and Login Tobbogin not playing nicely together.

bassam’s picture

StatusFileSize
new1.65 KB

I'm using the module 7.x-2.1-beta2

I created a patch that removes the error message and logs the user in after the registration.

If the user registers without an invitation, it will display a notification that the registration is pending admin approval.

mr.andrey’s picture

Issue summary: View changes

Subscribing. Using patch in #14 with Invite 7.x-2.