The settings form for setting up the login redirect is there.
But there's no logic in the module for performing the actual redirect.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

farald created an issue. See original summary.

Jitesh Doshi’s picture

Version: 8.x-1.0 » 8.x-1.x-dev
Assigned: Unassigned » Tcraw
Status: Active » Needs work

Thanks for reminding. Yeah, the first D8 release was a very basic release with very basic functionality. We will be implementing this soon. Assigning to Tcraw.

andriyun’s picture

Assigned: Tcraw » andriyun
Status: Needs work » Needs review
FileSize
4.64 KB
andypost’s picture

  1. +++ b/config/install/prlp.settings.yml
    @@ -1,2 +1,2 @@
    -login_destination: user/%uid/edit
    
    +++ b/prlp.module
    @@ -7,11 +7,6 @@
    -define('PRLP_DESTINATION_DEFAULT', 'user/%uid/edit');
    

    I'd better keep ability to configure destination
    but probably better to file separate issue for http://cgit.drupalcode.org/prlp/tree/src/Controller/PrlpController.php?h...

  2. +++ b/src/Controller/PrlpController.php
    @@ -81,6 +82,12 @@ class PrlpController extends UserController {
    +        return new RedirectResponse($login_destination, 302);
    

    302 is the default in SF

andriyun’s picture

@andypost I didn't remove this config completely.
By default login_destination config value is empty.
Destination is hardcoded in line http://cgit.drupalcode.org/prlp/tree/src/Controller/PrlpController.php?h...
and pointed to internal uri user/%uid/edit.

If we want to override destination url we need check Override destination checkbox and specify login_destination config.
Then these settings can be exported.

dpolant’s picture

Status: Needs review » Needs work

The patch seems to work pretty well. One problem though is that you get a bad request error if you leave the %uid token in there. I think we need to dynamically replace this before issuing the redirect.

tracipotocnik’s picture

Status: Needs work » Needs review
FileSize
4.72 KB

Updated the patch to be able to handle the %uid token.

Andrej Galuf’s picture

I fail to see what the purpose of the override checkbox is (suggested in #5).

The code should be written to either set the default value (if the configuration value is default or empty) or accept a custom value (if the value is configured).

I would also suggest to set the user token to %user instead of %uid, as this token already refers to a user in Views.

Suggested patch is attached.

lbogdan’s picture

Hi,

I tried your different patches but redirection is still not working.
I have "Access denied"...

Any idea ?

Thanks

weseze’s picture

Patch from #8 works great against version 1.3.

Only thing I noticed is that the "%front" replacement is no longer available, but I could just enter "/" to redirect to the frontpage.

michael_wojcik’s picture

Revised patch from #8 to include support of the '%front' replacement mentioned in #10. Interdiff included.

dalin’s picture

Assigned: andriyun » Unassigned
Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Patch works great.

Bumping to high priority since the whole point of this module is to improve UX, but without this functionality it's no better than Core.

Would be great to use the token system rather than these custom ones, but that's something for a separate issue.

maxplus’s picture

Thanks!
patch https://www.drupal.org/project/prlp/issues/2785087#comment-12218421 is working perfect for me (drupal 8.5.1 and prlp 1.3 and redirect path is /products)

Jitesh Doshi’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all for providing patches. I have committed the patch to 8.x-1.x branch.

Status: Fixed » Closed (fixed)

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

jcmartinez’s picture

@jitesh-doshi

Apparently you forgot to push the release after applying the patch. This code is not currently on the stable release and I doubt that it is on the dev release which is much older.

I had to apply the patch locally.

Thank you for this module. Very helpful.

abhou’s picture

Hi,

The last release of the module doesn't contain this patch. The issue is still here, I was able to fix it after applying the patch.

Thanks for the module, it's very useful.

Jitesh Doshi’s picture

Sorry @abhou and @jcmartinez. The fix was committed, but only available on the DEV branch. I have now cut a new release (8.x-1.4) that actually contains the fix for this issue.