Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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;
>
Comment | File | Size | Author |
---|---|---|---|
#1 | redirect-1300932.patch | 1023 bytes | kreynen |
Comments
Comment #1
kreynen CreditAttribution: kreynen commentedConfirming @josh.hill's fix works and submitting it as a patch.
Comment #2
Robert Castelo CreditAttribution: Robert Castelo commentedThanks, added to 7.x-1.2
Comment #3
Robert Castelo CreditAttribution: Robert Castelo commented