Redirection is wrong
vsr - September 20, 2007 - 22:30
| Project: | tellafriend |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
The default action is to send people to the homepage instead of the page that they were on before wanting to tell a friend. It should return them to the page that they clicked on tellafriend from.
So if they were on "site/how-is-it-made" and they click on tellafriend, they should be returned to "site/how-is-it-made" after they send an email.

#1
Ignore this patch, use the one in comment #2
Here's a patch to fix this issue.
Running on Drupal 5.11. (it's only been tested on two machine both running php5, mysql 5+, apache2+, etc...).
It's not ready for D6, the drupal_get_destination syntax has changed in D6
#2
this is an update to my patch in #1
It adds a checkbox on the configuration page to allow to choose to override the original redirection code (the incorrect code), which defaults to true. Also added is the !pagelink filter which allows you to point the recipient of the e-mail to the page the user clicked on the to get to the Tell a friend block from.
you need to patch both the module and install files
if you are simply looking to add a link in a block (not using the block provided by this module) and you have used this patch you will need to be sure to add the destination argument to the url of the Tell a Friend form.
example block link
<?php$destination = drupal_get_destination();
print(l('<img src="' .base_path().path_to_theme() .'/images/send-to-a-friend.jpg" >','tellafriend',NULL, $destination, NULL, FALSE, TRUE));
?>