After submitting the Terms and Conditions the form failed to redirect and instead reload itself (calling theme_legal_login() which display the following message minus the actual conditions.

To continue to use this site please read the Terms & Conditions below, and complete the form to confirm your acceptance.

Redirects in Drupal 7 have changed. Now need to use $form_state['redirect'] rather than $form['#redirect'] in Drupal 6. I couldn't get $form_state['redirect'] to work in legal_login_form() so I moved setting the redirect path to the submit handler legal_login_submit().

556,562d555
<   $redirect = 'user/'. $uid;
< 
<   if (!empty($_GET['destination'])) {
<     $redirect = $_GET['destination'];
<   }
< 
<   $form['#redirect'] = $redirect;
602a596,604
>   // Set redirect path
>   $redirect = 'user/'. $user->uid;
> 
>   if (!empty($_GET['destination'])) {
>     $redirect = $_GET['destination'];
>   }
> 
>   $form_state['redirect'] = $redirect;
> 	
CommentFileSizeAuthor
#1 redirect-1300932.patch1023 byteskreynen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kreynen’s picture

Status: Active » Needs review
FileSize
1023 bytes

Confirming @josh.hill's fix works and submitting it as a patch.

Robert Castelo’s picture

Thanks, added to 7.x-1.2

Robert Castelo’s picture

Status: Needs review » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.