1

I try to register in my site; after a successful registration, I get redirected to the home page, but the following message is not displayed.

Thank you for applying for an account. Your account is currently pending approval by the site administrator.

In the meantime, a welcome message with further instructions has been sent to your e-mail address.

The standard core mail functionality is used, and no hook or rule is used for that registration.

Why doesn't the message appear?

I tried changing theme, but the message is still not appearing. Furthermore:

  • The $message variable is available in the template file
  • I am not using the Boost module; I am using the Mime Mail module to get HTML emails

How do i customize the message in some hooks?

  • @molot: Tried Purr Messages. Still it doesnt display anything. – Ram Sep 2 '13 at 9:26
  • @Ram seems you have exhausted my usual check-list for missing message. Sorry. – Mołot Sep 2 '13 at 12:44
  • @Mołot: I have given this one, 'Visitors, but administrator approval is required' in the account settings.Mail and everything is working fine but message alone not working. in which hooks i can add that message to be displayed in home page after registration is successful?Any suggestions ? – Ram Sep 2 '13 at 12:54
  • well, if workarounds are acceptable then yes, I do. But please edit that little note into a question itself, OK? Don't want to get downvoted for going offtopic. – Mołot Sep 2 '13 at 13:23
  • Are you redirecting to the home page in any certain special way? – SDMulroy Jun 22 '14 at 2:35
1

A workaround would be to manually create message in hook_user_insert, with code like:

function mymodule_user_insert(&$edit, $account, $category) {
  drupal_set_message(t('Account created, wait for approval.'), 'status');
}

Alternative place is hook_entity_insert:

function mymodule_entity_insert($entity, $type) {
  if ($type == 'user') {
    drupal_set_message(t('Account created, wait for approval.'), 'status');
  }
}

Problem is - it is possible that the same error will hide this one too. Benefit: it's easier to experiment with small custom hook, than to debug core.

  • Still same thing, i tried 'mymodule_user_insert' but it didn't show the message after registration – Ram Sep 2 '13 at 14:00
  • 1
    @Ram well, see the last paragraph ;) But now you can test if it at least writes to watchdog. – Mołot Sep 2 '13 at 14:02
  • still no luck.No error messages too in watchdog. – Ram Sep 3 '13 at 15:10
  • @Ram If neither of these 2 hooks is ever fired for you (and that's how it looks, you can test it with die() to be sure), the problem is way deeper. It looks like some other module provides hook on the same action and somehow prevents yours (or even default) from firing. First time I hear about thing like that - I mean, I've seen conflict between 2 contrib modules, but never between contrib and core. – Mołot Sep 4 '13 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.