Hi,

I tried redirecting from the user login block but redirection does not work, it only works from user/login

For Exmaple :
localhost/drupal/user/login?test=https://www.google.co.in/?gws_rd=ssl is working but
localhost/drupal/?url=https://www.google.co.in/?gws_rd=ssl(after entring this URL on the page trying to login from block) not working.

Comments

Prashant.c created an issue. See original summary.

aditya_anurag’s picture

aditya_anurag’s picture

StatusFileSize
new1.56 KB

Hi,
I checked the issue, Drupal login block don't all user to redirect to external link so it wasn't redirecting. I created a patch try applying that it will work.

aditya_anurag’s picture

StatusFileSize
new2.92 KB
aditya_anurag’s picture

Status: Active » Needs review

heykarthikwithu queued 4: login_form.patch for re-testing.

aditya_anurag’s picture

Issue tags: +code
jweowu’s picture

I think it's better to define the individual hook_form_FORM_ID_alter functions, and have each of them call a common helper function. That prevents the unnecessary call to a hook_form_alter implementation for ALL forms.

(But if you *did* keep using hook_form_alter, I would suggest inverting the form_id test and bailing out early when it doesn't match, which avoids nesting the entire function body.)

GeeUnit’s picture

I am facing the same issue. I am trying to navigate the user to an external URL on login which works for /user/login?url=https://www.google.co.in/?gws_rd=ssl but doesn't work from the user login block.

I applied the patch mentioned in #4 but that did not fix the problem (user/login?url=https://www.google.co.in/?gws_rd=ssl stopped working too)