Status Messages not being displayed after registration
curtgadget - October 17, 2007 - 15:41
| Project: | Drupal |
| Version: | 6.x-dev |
| Component: | user system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Seems like drupal_set_message or the user.module is the culprit here.
Whenever someone registers a new account, or resets their password, they are just taken back to the homepage or to the login page, but no status message is displayed.
Extremely annoying since my users dont know what is going on.
Im running drupal on php 4 red hat setup.
Modules of interest installed: devel, invite (disabled), loggintobbagin, buddylist, captcha, and a few custom modules.
I thought logintobbagin was the culprit so i uninstalled it but no dice.
Please let me know if you need anymore info..
Thanks

#1
i'm also having the same issue
when "send email" is clicked in the contact module:
status messages like "the message has been sent" is displayed while logged in as administrator
such status messages are not displayed while logged in as anonymous user
code excerpt from "page.tpl.php" which prints messages:
/*************************************/
<?phpif ($messages):
?>
<?phpprint $messages;
?>
<?phpendif;
?>
/***********************************/
code excerpt from "contact.pages.inc" in contact module :
/***********************************************************/
function contact_mail_page_submit($form, &$form_state) {
....
drupal_set_message(t('the message has been sent.'));
....
}
/**********************************************************/
when "send email" button is clicked, "subject" and "message" entered in the contact module is sent to the appropriate email id. but the status message "the message has been sent" is not displayed while logged in as anonymous user.
plz help me to solve the aforeseen issue.
#2
Try to set on admin/user/logintoboggan some 'Redirect path on Registration' (i.e.: 'node') and check if message will appear.
I think there is some problem in logintoboggan_user_register_submit(), when redirect is empty, it's not showing any messages.
<?php
...
$redirect = _logintoboggan_process_redirect(variable_get('logintoboggan_redirect_on_register', ''), $account);
// Log the user in if they created the account and immediate login is enabled.
if($reg_pass_set && variable_get('logintoboggan_immediate_login_on_register', TRUE)) {
$form_state['redirect'] = logintoboggan_process_login($account, $redirect);
}
else {
// Redirect to the appropriate page.
$form_state['redirect'] = $redirect;
}
...
?>
It's the same problem on 6.x.
#3
i've tested this issue with both immediate login turned on and off, and with no path and with a path entered in 'Redirect path on Registration' -- everything works as expected as far as i can see.
perhaps there's another contrib module causing issues here...
#4
So we should find out what's the reason and which version is affected with combination with which module and fix that.
Because there is some relation of LoginToboggan, because if you set some: 'Redirect path on Registration' to 'node', it's working fine, if you leave this empty, it's not working.
I can try to debug that later and find out.
P.S. Please don't mark the issues as Close from Active state, because non of the users will receive notification of changes of this issue.
#5
Probably this issue also mess up with permission, but I'm not sure.
When user register (using content_profile + view_own), this user have no permission to his own profile (even proper permission is set).
Probably it's redirecting before it can execute node_access_acquire_grants() for this node.
#6
Backtrace:
autoassignrole_path -> drupal_get_form('user_register') -> drupal_process_form() -> form_execute_handlers() -> logintoboggan_user_register_submit()
#7
In one of my case the was problem that user with uid = 0 was not in my database (users table). Something removed it from users table and Drupal couldn't load the session.
Related topic:
How can I restore UID 0 - http://drupal.org/node/262669
Related issue to missing uid 0:
#293508: CAPTCHA doesn't work: no uid=0 in users table
#8
#9
It's not solved yet, there is some problem and it should be fixed in proper way.
Some module is modifying uid 0 and sometimes it's removing it.
#10
this is not a LoginToboggan issue, therefore it is fixed as far as i'm concerned. if you discover which module it is, then feel free to reopen the issue under that module's issue queue.
#11
in that case it should be CLOSED, not FIXED, right?
#12
@alextronic: the system will automatically close issues marked as fixed if they haven't been updated in two weeks. this allows people to see the issue in default listings for a bit before it disappears into the closed state.
#13
We've had exactly the same problem. Seemed that user 0 was missing.
INSERT INTO `users` (`uid`, `name`, `pass`, `mail`, `mode`, `sort`, `threshold`, `theme`, `signature`, `signature_format`, `created`, `access`, `login`, `status`, `timezone`, `language`, `picture`, `init`, `data`) VALUES(0, '', '', '', 0, 0, 0, '', '', 0, 0, 0, 0, 0, NULL, '', '', '', NULL);
And set uid=0 for this user after that, because it's an autoincrement.
No idea how that messes up with drupal_set_message exactly. Because when printing the $_SESSION['messages'] variable, by using var_dump just after the drupal_set_message call in user.module's user_registration_form_submit() function, it showed the right messages which drupal_set_message could not show.
I wonder, is there a function in drupal that actually *prints* the output from drupal_set_message? There must be the logic.
Anyway, it's solved for us. Hopefully helped you too. Very very frustrating bug this was.
#14
#15
@eddy147
Try:
<?php if ($messages): print $messages; endif; ?>Or:
<?php print theme('status_messages'); ?>...anyway, I have created user uid=0 and still no joy. Ouch.
#16
again, this is not an LT issue. moving to what seems like the most appropriate queue.
#17
now you're right
#18
#19
Hello all
I found this thread through google - agree it's not a Login Toboggan problem as I don't use that module. Hummonk, I wasn't sure what queue you had moved this too; so in case people are still in their early days of finding their way through Drupal I'm throwing in my tup-pence worth...
I did some more digging around Drupal and found the solution in these two threads:
http://drupal.org/node/217607
http://drupal.org/node/262669
For me, in my Users table I actually had the UID of 0, but in my user_roles table I was missing the UID of 0 having the RID of 1.
I'm setting this to fixed now too as it isn't a login toboggan specific issue.
Cheers
Halfabrain
#20
That's why issue has been moved to Drupal bugs, but anyway it's not fixed as a bug.
Something removed that row from db which should be there and if somebody will find the reason, he can re-open.
#21
Automatically closed -- issue fixed for 2 weeks with no activity.