Closed (fixed)
Project:
FriendList
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2008 at 01:45 UTC
Updated:
18 Jun 2009 at 07:43 UTC
Testing this module at multilingual site (path prefix)
I found bug in friendlist_ui.module - All links appended by destination=$_GET['q] wich leads to 404 page
This problem caused by friendlist_ui_destination() function
Suppose beter to use drupal_get_destination() wich works fine! So friendlist_ui_destination() shoul be removed - I found no occurrences of it's usage.
// Et voila - return the link, ready to be used by themes etc.
return $popups_body . l(t($link_text, array('!rt_name' => $rt->name, '!rt_name_p' => $rt->name_p)),
$link_href,
array(
- 'query' => 'destination='. friendlist_ui_destination(),
+ 'query' => drupal_get_destination(),
'attributes' => array(
'class' => "$popups_style friendlist_ui_${status}_$op",
)
)
);
| Comment | File | Size | Author |
|---|---|---|---|
| dest.patch | 1.55 KB | andypost |
Comments
Comment #1
mariusooms commentedMerc...did you review this, so we can commit it?
Marius
Comment #2
andypostThis patch still valid, this is simple
Comment #3
mariusooms commentedCommitted and thanks!
Marius
Comment #4
mercmobily commentedHi,
There is a reason why there was friendlist_ui_destination() . Here it is: basically, if a site has URL renaminc, and it's set so that /user/12345 is changed as user/merc , then I would like the links returned by the module to be *url_aliased* rather than not. Otherwise, people who want to absolutely hide user/12345 will be screwed :D
At the moment, drupal_get_destination doesn't do that -- whereas friendlist_ui_destination does, although it might create problems with multilingual sites. I think the trick is to fix friendlist_ui_destination() , _and_ open a feature request with Drupal where you ask them to have a get_destination function which returns an url_aliased URL...
Irakli, what do you think?
Sorry, reopening this one...
Merc.
Comment #5
irakli commentedI think Merc has a good point.
This probably needs a little bit more tweaking.
Thanks everybody
Comment #6
mercmobily commentedHi,
I reverted the devel version of the module to what it was before the patch.
The best path at this point is to:
1) Fix friendlist_ui_destination() so that it works, for the short term
2) Open an issue in Drupal where we request a better drupal_get_destination(), for the long term
I have never created a multilingual site... andypost, I don't suppose you would be able to give me the simplest possible list of steps to reproduce this by installing a multilingual site (see: "bare minimum") with FriendList?
Thanks a lot,
Merc.
Comment #7
andypost@Merc setup is simple - just add another language (admin/settings/language), choose path prefix type (admin/settings/language/configure), at admin/settings/language/edit/en add path prefix for language (for example en)
Suppose that destination should not be changed because it just remember previous page or current page so no need to analyse. Take a look at http://api.drupal.org/api/function/drupal_get_destination/6
if you already on user profile page (possible with rewrite) drupal_get_destination give you this page!
Comment #8
mercmobily commentedHi,
I don't have admin/settings/language -- what module do I have to enable?
Merc.
Comment #9
andypostlocale :)
Comment #10
mercmobily commentedHi,
OK, sorry... I am a little multi-language-inept!
Merc.
Comment #11
mercmobily commentedHi,
*** I am an idiot, ***
You (ALL of you) were correct, got rid of my idiotic function, reverted to drupal_get_destination.
Sorry.
Merc
Comment #12
mercmobily commentedComment #13
mercmobily commented