Add option to redirect to current path

Created on 16 January 2023, about 2 years ago

Problem/Motivation

Currently the Redirect Settings options are:

  • Custom redirect path
  • Redirect to this display

But there are use cases in which you may not have a specific redirect path that you want the user to end up on and you want to just return the user to the page they were on.

Proposed resolution

Add an option to the Redirect Settings for Redirect to current path that, when checked, will redirect the user back to the page they were on.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada nord102

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs review about 2 years ago
  • First commit to issue fork.
  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

    I cleaned up the redirect fieldset a little bit by adding a Redirect to radio group. I wrote an update hook to migrate existing views.

  • Merge request !32Resolve #3333971 "Add option to" β†’ (Open) created by dieterholvoet
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 year ago
    2 pass, 2 fail
  • πŸ‡¬πŸ‡§United Kingdom danharper

    Tested the MR on 2.x-dev and it works great for me.

  • redwan jamous β†’ made their first commit to this issue’s fork.

  • HTTP_REFERER will be empty if the display link was accessed directly, in that case we would want to fallback to front page.
    I updated the MR to handle this case.
    Attaching a static patch file to use with composer...

  • Pipeline finished with Failed
    4 months ago
    Total: 164s
    #366862
  • πŸ‡ΊπŸ‡ΈUnited States rsnyd

    Tested on core 10.4.1 with views_data_export 8.x-1.5 using merge request .diff in patches section of composer managed site. The Merge request applied cleanly and I now see 4 options for "Redirect to" under "Redirect Settings".

    Active display
    Other display
    Custom path
    Front page

    Active display does keep you on the same url once batch completes.
    Other display and Custom path seem to function as before.
    Front page does indeed redirect you back to the front page of site.

  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels
  • πŸ‡¬πŸ‡§United Kingdom steven jones

    I feel like Drupal should be able to generate a link with the destination parameter set? It does this a lot for other links etc. and I think that would be better than fetching the referrer header, which isn't even set by some browsers.

    Is there a reason I'm missing why we're not using the destination parameter?

    Also, we need some tests for these changes.

Production build 0.71.5 2024