Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drupal: drupal_set_message doesnt display a message

Tags:

drupal

I cannot seem to get a message from drupal_set_message when a user registers on my site. I'm using Drupal 6.14.

Adding a print in the user.module:

function user_register_submit($form, &$form_state) {
  ...
      if ($notify) {
        ...
      }
      else {
        drupal_set_message(t('Your password and further instructions have been sent to your e-mail address.'));
        print 'xxxxxx';
        $form_state['redirect'] = '';
        return;
      }
    }
    ...

}

It prints 'xxxxx';

A var_dump of the $_SESSION variable gives the status message, which drupal_set_message doesnt display, so that looks fine also.

I've uninstalled all my modules, only core remains, and using Garland now as a theme.

Furthermore, I've installed a fresh Drupal installation, and there it gives me a nice status message.

Then i compared my .htaccess and Drupal's, from the fresh install. Modified mine to make them equal.

Nothing helps.

Any thoughts?

like image 757
eddy147 Avatar asked Oct 03 '09 09:10

eddy147


1 Answers

We just solved it. Apparently, user 0 was missing, somebody deleted it or some module did it. After inserting it into the database we got our messages again.

This is what you have to do:

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 after that set the uid to 0, because uid is an autoincrement!!

No idea still how that messus up with drupal_set_message, though.

like image 142
eddy147 Avatar answered Sep 23 '22 09:09

eddy147