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

  1. Enable a login destination rule which redirects to an arbitary page.
  2. Enable the preserve_destination configuration option.
  3. Visit the home page and click login.
  4. 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.

CommentFileSizeAuthor
#7 3314925-7-revert_query_parameter.diff596 byteskalpaitch
Command icon 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

kalpaitch created an issue. See original summary.

kalpaitch’s picture

Issue summary: View changes
LeoAlcci’s picture

I'll work on it!

LeoAlcci’s picture

Assigned: Unassigned » LeoAlcci

kalpaitch’s picture

I 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 current query parameter to a destination query parameter was made though? I'm suggesting reverting it.

kalpaitch’s picture

Status: Active » Needs review
StatusFileSize
new596 bytes
LeoAlcci’s picture

Assigned: LeoAlcci » Unassigned
LeoAlcci’s picture

Status: Needs review » Reviewed & tested by the community

Yep, it's working as intended now! Moving to RTBC.

  • rsvelko committed 2fc7b3d on 8.x-2.x
    Issue #3314925 by kalpaitch, LeoAlcci: Always redirects to current page...
rsvelko’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.