Hi,

I have installed actions 5.x-2.6 on drupal 5.10 (of course will update to 5.11 ;-)
My aim is to redirect user after they have logged in to a special url ("webfm" - the webFM Manager).

I created an "advanced action" "Redirect to URL" and configured the URL webfm.
Then I chose the trigger "Trigger: After a user has logged in".

After that I tried to log in as a user - but the frontpage stayed the same.

What did I do wrong?

thanks

4k

Comments

4kant’s picture

Sorry - but after 2 weeks without any answer, I´d like to ask whether somebody can tell me:
the way I tried to achieve the redirect - did I do that right?
Or did I misunderstand the usage of these modules?

Thanks

4k

jvandyk’s picture

You are doing it right. But, there is a problem. The Redirect to URL action calls drupal_goto() to do the redirect to the new URL.

But drupal_goto() isn't doing what it was told.

That's because drupal_goto(), before going to the URL you passed, checks to see if the destination has been set. If it has been set, it ignores the URL you passed in!

From the code comments for drupal_goto():

 * Usually the redirected URL is constructed from this function's input
 * parameters. However you may override that behavior by setting a
 * <em>destination</em> in either the $_REQUEST-array (i.e. by using
 * the query string of an URI) or the $_REQUEST['edit']-array (i.e. by
 * using a hidden form field). This is used to direct the user back to
 * the proper page after completing a form. For example, after editing
 * a post on the 'admin/content/node'-page or after having logged on using the
 * 'user login'-block in a sidebar. The function drupal_get_destination()
 * can be used to help set the destination URL.

We can either rewrite the code that executes in the Redirect to URL action to not call drupal_goto() and just do the redirect itself, or we could write a new action called "Redirect to URL (force)" or something.

But anyway, that's why you're experiencing the behavior you reported.

bsenftner’s picture

Version: 5.x-2.6 » 5.x-2.x-dev
Category: support » bug
Priority: Normal » Critical

This exact issue occurs in Drupal 6.16 as well. I tracked it down to the destination being set, hijacking the action's intended path. Is anyone looking to fix this?

z1rra’s picture

I would also like a solution to this issue. I understand that there's a module called Login Destination but the last time i used it, it made my login block not work at all so I'd rather not use it.

pomliane’s picture

Status: Active » Closed (won't fix)

This version of Actions is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.