3

I try redirect user to specific tab on user profile page. I found couple solution how I can do that but it doesn't work if I use login form modules like Super Login, Bootstrap login form, fancy login, etc. When I try redirect user via trigger It give me AJAX error.

Then I try use Rules module and it doesn't redirect after login at all. All of it works fine if I login through standard login form.

I spent 2 days for this issue and can't find any solution. Please give me right way how to do that.

I use Bootstrap login module

link to my tab: user/[account:uid]/mytab

This is my rule:

    { "rules_red" : {
"LABEL" : "redirect",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "user_login" : [] },
"DO" : [ { "redirect" : { "url" : "user\/[account:uid]\/mytab" } } ]
 }
}
3
  • Please spend 2 more minutes on your question here to include an export of your rule which doesn't perform the redirect as you'd want (and also include the path (s) that you're using for those special tabs on the profile page. Commented Feb 9, 2017 at 9:13
  • Many modules that do a redirect after login use drupal_goto() to redirect after login. However, if logging in through Ajax, this call to drupal_goto() breaks the ajax response, which is why you see the ajax error. For the Fancy login module (which I'm the developer of), if you want to have a redirect after login, you need to create a custom submit handler, and set the redirect on $form_state. The module will respect that and redirect when submission is complete. The module is not compatible with Rules and Login Toboggan.
    – Jaypan
    Commented Feb 9, 2017 at 9:34
  • Jaypan, unfortunately my knowlage in this case very simple and I can't dfo that =( maybe anyone know another way?
    – NashGC
    Commented Feb 13, 2017 at 13:14

2 Answers 2

0

I found out how to solve this issue. I install popup module and activate popup block submodule. then go to block and set "User login" block in "Navigation" region (I use bootstrap theme), after that open configuration of "User login" module and do it popup. I hope it will usefull for anybody.

0

You can alter the form in custom module and alter its submit hook , so after submission it will redirect to your desired destination

1
  • unfortunately, I don't have appropriate skill for use hook yet.
    – NashGC
    Commented Feb 20, 2017 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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