I have setup a destination, and it works fine when I login from the login page (user/login), but I have a login block on the front page and when I login from there, it redirects to the default front page as set in admin/config/system/site-information

Is there something I need to do to make it work?

Comments

mithy’s picture

Check the "preserve destination" setting.

spineless’s picture

This module does not work.

I entered the destination rule and with the "Preserve destination" selected either on or off I still do not get redirected to the page with the login link.

I have also attempted to use the login in "Block" and that does not work either.

I am using oneall social login module and I notice that when I have your module enabled it interferes with the redirect provided by oneall social login. So I know your module is interacting with other modules but I have not been able to get it to work.

spineless’s picture

Category: support » bug

I am using the standard Drupal registration and login block and when I login using the block I can be redirected back to the page. However when I register a new user the last page I see in the user/%/edit page. I cannot get the module to work so it redirects to the or last page visited.

I set the "preserve destination" to both on and off. This switch has no effect.

I think this module ( login_destination-7.x-1.0.tar) is broken. It does not work with the login block.

mithy’s picture

Status: Active » Postponed (maintainer needs more info)

It does not help much writing that the module is broken. It works perfectly for most of the users (the functionality you are mentioning also). From your description I cannot understand whether it is the login block or the registration page that is causing the trouble. Please fill a proper bug report, provide the steps you went through, specify the configuration you have. Try to isolate the cause by switching off other modules that might interfere with LD.

spineless’s picture

I created a test site for the troubleshooting of this module. I am using Drupal 7.16 and Login Destination 7.x-1.0

I only have the following modules added.

admin_menu
book_made_simple
Entity
Rules
Login_destination

All of these modules have been disabled except your module.

I created a book with 3 pages.

I configured a new login_destination rule with the following parameters.
... redirect to page:
... redirect upon trigger: login, registration, one-time login link
... all other parameters were left empty.

I configured the login_destination setting
... I did not click on "Preserve the destination parameter"
... I did click on "Redirect immediately after using one-time login link"

I saved the configuration and logged out as the administrator.

I then navigated to node/112 (Example Book) and created a new account. I assume that I will return back to node/112.

I entered the username, email and password for the new user and clicked on save.

I was then directed to the user edit page. I clicked on save....

I never returned to node/112

Please go to the development website I set up for this test and see for yourself.

http://devpro.pinterec.ca

Admin credentials
... user: devpro
... password: ZX12qw

spineless’s picture

Status: Postponed (maintainer needs more info) » Active

I updated the version on this site to 7.x-1.1+2-dev so as to be working with the latest version.

The issue still exists.

spineless

spineless’s picture

Title: Redirect works fine from login page, but not when using login block » This module does not redirect a newly registered user using the login block
Version: 7.x-1.0 » 7.x-1.x-dev
Priority: Normal » Critical

I did some more testing and was able to narrow down the issue to a single problem.

I created a new install of Drupal 7.17 and installed login-destination 7.x-1.0-dev.tar.gz.

I set up the following:

config/people accounts so that any visitor could register without any approval.
config/people/login-destination/settings with redirect immediately after using one-ime login link

I set up a login destination rule so all pages and all users would be redirected to the page.

I then created a page and navigated to that page.

I created a new account using the blocks login form -> the result was I ended up at the user account edit page.
I created another user account using the link "register" at the bottom of the page. -> the result was I ended up at the user account edit page.

I then added the following:

config/people/login-destination/settings with "preserve the destination parameter"

I repeated the above test and again when I register a new user using the login block it does not work. However, when use the link "register" at the bottom of the page I get redirected to the current page as I hoped.

Now, just to be sure I did go back and attempt to login ( not register a new user) and everything appears to work ok including login in from the login block.

________

Conclusion

When you attempt to register a new user using the LOGIN block the module does not redirect the user back to the page.

Hope this helps.

spineless

ddrozdik’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

I tried reproduce this issue on the latest version of module, and module works good. I guess issue could be closed as it is not reproducible.

mchampsee’s picture

Status: Closed (cannot reproduce) » Needs work

Here is what I'm seeing....

If you set redirection to a specific page (i.e. node/5), redirect from register works fine. However, if you set redirection to <current>, then register doesn't redirect. If you look at the front-end, login links are appended with the current page (i.e. user/login?current=node/5), however register links are not. If you go to user/register?current=node/5, then you will get redirected to node/5 just fine. If you install Login Toboggan and check the box for unified login/registration page and access that page via user/login or user, you will get redirected properly as well.

For whatever reason, it appears as though if you set the alter flag in hook_menu_link_alter, it doesn't call hook_translated_menu_link_alter for the user/register page.

mchampsee’s picture

A potential work around is to put something like this into your template.php file:

function theme_link($link) {
	if ($link['path'] == 'user/register') {
		$link['options']['alter'] = TRUE;
		$query = array ('current' => $_GET['q']); 
		$link['options']['query'] = $query;
	}
	return theme_link($link);
}
chanderbhushan’s picture

Status: Needs work » Needs review

Tested with 7.x-1.x branch redirect is working fine for internal and external links for both user/login page and block