When a new user registers and an e-mail approval is required, drupal simply redirects the user to the home page with no message telling the user to check his/her e-mail. This is frustrating as the new user has no way of knowing what just happened until they happen to check their e-mail.

I have seen a couple of other threads on this but all have been closed with somewhat ambiguous conclusion (eg. http://drupal.org/node/162037, http://drupal.org/node/161496).

Is there a solution for this already or is one in the works? If not, what can I do in the mean time to display a message to the user.

I appreciate your support.

Comments

genzeb’s picture

Okay, I've done more exploring and here is the situation. In the user.module, the method user_register_submit does set the appropriate message for the specific drupal setting. In my case, since email verification is required, the message reads "Your password and further instructions have been sent to your e-mail address." Now, if I insert a debug statement when this message is set, I do see the message as being added to the SESSION object:

  function user_register_submit($form, &$form_state) { ...
       print_r($_SESSION); //prints out: Array ( [messages] => Array ( [status] => Array ( [0] => Your password and further instructions have been sent to your e-mail address. ) ) )
...} 

However, this and any other message set from the user.module seem to disappear once the form is fully processed. That is, the message does not exist when the form submission is processed, regardless of url redirection. In particular, if I check the messages or _SESSION variables from page.tpl.php, they are both empty.

Of course messages do work for all other cases/content. In particular, messages I have added to my own pages work. If I use the drupal_set_message method to set messages, I do see the message displayed (regardless of url redirection).

This has been very frustrating and I am not sure how to proceed. I appreciate any comment on this.

VM’s picture

first thing I'd do is test 6.12 to see if the issue hasn't already been fixed.

If not fixed in 6.12, I'd check 6.x-dev

genzeb’s picture

I've more updates. It seems the problem is specifically this version of drupal seems to ignore all messages on a redirect for anonymous users. Specifically, if a page sets messages but does not redirect (via drupal_goto() for example), then the message is displayed. If the page sets a message then redirects to another, the message is lost. For authenticated user, that is not the case. Messages are always shown regardless of redirection.

genzeb’s picture

What a complete waste of time.

The problem has always been the fact I had deleted (or rather changed) users table uid=0. Apparently this table is needed for drupal to properly initialized the SESSION variable. Without session, no persistent messages. Since of course the users table uid column is a 'int(10) unsigned auto_increment', most attempts to add a new user with uid=0 will fail. The key here is to modify the column and remove unsigned. Drupal doesn't care. And in most cases, what used to be uid=0 is incremented to be the last user in the uses table. So, just modifying that user to have uid=0 is sufficient. You may need to rest your auto_increment start value (ALTER TABLE users AUTO_INCREMENT=###).

Problem solved.

Many many discussions on this topic btw. For example, see: http://drupal.org/node/262669, http://drupal.org/node/353428

genzeb’s picture

Status: Active » Closed (fixed)

I am closing this with the following comment: drupal should stop using (or at least requiring such a fake user exist in the users table) uid=0 to establish anonymous user. There has to be a better way.

s.Daniel’s picture

Version: 6.10 » 7.x-dev
Category: bug » feature
Priority: Critical » Normal
Status: Closed (fixed) » Active

As a note for others: This problem can arise when copying user data from one database with another.

Feature requ: Could we have a check for this issue in the status report?

stephencamilo’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)
hestenet’s picture

Status: Closed (won't fix) » Active

Reset issue status.

apaderno’s picture

Category: Feature request » Bug report
Status: Active » Closed (works as designed)

Let's close this issue, which was open as bug report, but that was caused by removing/altering the table row for anonymous users.

For the feature request, I will open a new issue, even if I doubt it will be implemented.