1

I have a site with about 30 members, but I just added a new mandatory field on the registration. I want the old members to be forced to fill this in as well. What would be the best way to do this?

  • Do you have developing knowledge? – Yuseferi Sep 20 '12 at 4:33
1

Choose one:

  1. Use the rules module to test whether the user has authenticated and the field value of the current user is empty. Redirect to user/[uid]/edit if this is the case.
  2. Do the same test in a module during your implementation of hook_init(). Call

    drupal_goto('user/[uid]/edit')
    

    to redirect to the user edit page.

  3. Do the same test in a module during your implementation of hook_init(). Call

    menu_set_active_item('user/[uid]/edit');
    

    to show the user edit page.

Replace [uid] by the user id of the currently logged in user.

In cases 1 and 2, you also have to make sure that you do not redirect from 'user/[uid]/edit' back to 'user/[uid]/edit'. This would create an infinite loop of redirections, because the POST data gets lost when redirecting.

Documentation:

| improve this answer | |
  • I couldn't make a rule that would take them to the edit page, but I made a rule that takes them to their account and gives a message to "edit account". Good enough for me. Everytime I tried to make it go to "user/[account:id]/edit" it would give me an access denied error. Weird. – EGHDK Sep 23 '12 at 1:58

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.