Does not redirect

Matt B - July 24, 2008 - 21:02
Project:Login Destination
Version:6.x-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:ToDo
Description

I have preserve desitnation checked, static url selected, and a URL of 'content'. Condition settings, I have list of paths selected, and a path of 'about'. When I login from the about page I do not get redirected to the content page. If I login from another url (eg node/123) I am on that URL when logged in.

This worked fine on 5.7

#1

ardas - July 25, 2008 - 09:09

Dear Matt,

Please post all your settings, including page URLs you are logging from as well as their URL aliases. I have a testing environment and will be able to reproduce this scenario.

Thanks.

#2

Matt B - July 26, 2008 - 06:17

ARDAS, thanks for looking at this. Please note I have the Front Page and LoginToboggan modules installed.
URL destination settings
- Preserve destination - checked
- Static URL - checked
- URL: content

Redirection Settings
- List of Paths - checked
- Redirect condition - about

URL aliases:
about-> node/1
content-> (page view set up on views 2 module)

On Drupal 5 I had exactly the same settings, using login destination 5.x-1.x-dev, except 'Preserve destination' was not an option.

Is there anything else you need to know?

#3

drewish - July 29, 2008 - 00:05

yeah, something else got "fixed" in the latest version. haven't had a chance to debug it.

#4

drewish - July 29, 2008 - 06:34
Status:active» needs review

so my problem turns out that the return format changed without providing any notice. i've done my share of stupid undocumented backwards compatibilty breaks but it would have been a good idea to do a 2.x beta release so people could test it out.

the down side of the new format is that you can't specify the options to url() to do things like change the language. i changed the return format yet again to return two elements 'path' and 'options' (like url accepts) and did a little clean up on the code to remove some unused bits.

AttachmentSize
login_destination_286877.patch 2.65 KB

#5

drewish - July 29, 2008 - 06:55
Status:needs review» needs work

scratch that last patch... it doesn't work when you return a string. might be best to just return an array in any case. i think until this settles out i'm going to back to the 6.x-1.1 release and apply the patch to fix the menu access.

#6

ardas - August 4, 2008 - 08:11

Dear Matt,

The reason of your problem is that you were using aliases instead of internal paths. Login_destination module doesn't accept aliases. Please use internal paths instead. Change about to node/1 and everything will work fine.

I think that there is no sense in supporting aliases. This will influence performance.

#7

ardas - August 4, 2008 - 09:34

the down side of the new format is that you can't specify the options to url() to do things like change the language. i changed the return format yet again to return two elements 'path' and 'options' (like url accepts) and did a little clean up on the code to remove some unused bits.

Why you can't? I've just checked, you can use this snippet

return array('path' => 'node/1', 'query' => 'x=1', 'fragment' => 'ABC'); to redirect to the URL like this node/1?x=1#ABC

I was unable to redirect to an external site using this statement
return array('path' => 'http://www.google.com', 'external' => true);

I found a problem when multiple languages are configured. The redirection was performed incorrectly - prefix was dublicated.

#8

drewish - August 4, 2008 - 16:24

i don't have time to test it right now but the problem i was running into is that i need to switch the language during redirection so i need to pass $language into url()'s options parameter.

I was unable to redirect to an external site using this statement
return array('path' => 'http://www.google.com', 'external' => true);

shouldn't it be 'absolute' rather than external?

#9

Matt B - August 8, 2008 - 07:02

Dear ARDAS

Thankyou, changing to internal paths worked. Using aliases in the drupal 5 version of the module worked fine, how is it that this is not available on drupal 6? This means everyone upgrading from 5 to 6 who used aliases for the redirect condition will need change their configuration - not a major problem for most people, but it does give the appearance of a step backwards... thanks again for your help.

#10

rsvelko - October 21, 2009 - 12:36

please s.o. check how 2.5 behaves in the light of this issue..

I will see into this myself later

 
 

Drupal is a registered trademark of Dries Buytaert.