Problem/Motivation
login_destination_link_alter sets the drupal destination query parameter on all 'user.login' and 'user.logout' links.
This was changed 2 weeks ago, previously it set the current query parameter on these links.
The issue with this is that if there is a drupal destination query parameter set on a url AND the preserve_destination configuration option is set, then the drupal destination query parameter will always take precedence - see LoginDestinationManager::prepareDestination()
Steps to reproduce
- Enable a login destination rule which redirects to an arbitary page.
- Enable the preserve_destination configuration option.
- Visit the home page and click login.
- I am always redirected back to the home page, even though I have a login destination rule which wants to redirect me elsewhere.
Proposed resolution
Remove login_destination_link_alter completely.
The LoginDestinationManager::prepareDestination() method defaults to setting the destination parameter to the current page if no other rules are set.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3314925-7-revert_query_parameter.diff | 596 bytes | kalpaitch |
Issue fork login_destination-3314925
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kalpaitch commentedComment #3
LeoAlcci commentedI'll work on it!
Comment #4
LeoAlcci commentedComment #6
kalpaitch commentedI can see the change was made as part of this issue - https://www.drupal.org/project/login_destination/issues/3257760
I can't see why the change from
currentquery parameter to adestinationquery parameter was made though? I'm suggesting reverting it.Comment #7
kalpaitch commentedComment #8
LeoAlcci commentedComment #9
LeoAlcci commentedYep, it's working as intended now! Moving to RTBC.
Comment #11
rsvelko commented