I saw the post http://drupal.org/node/462012 but for me it's not working.
I created a triggered rule - "A node has been flagged, under "Agenda" (Agenda is my node) with a single "DO" action: "Page Redirect" to "user/register".
I checked "Force redirecting to the given path, even if a destination parameter is given".
"Link Type" is set to Normal Link.
But when click on the flag link on the node the url given is "http://www.example.com/flag/flag/agenda/1040?destination=node%2F1040&tok..."
And of course back to the same node when I click.
This occurs both with anonymous user (Session API installed) and with authenticated user.
Can anyone help?

Comments

rogeriodec’s picture

Priority: Normal » Critical

I actually spent many hours trying to debug this module, but I'm not an expert in php.
The only thing that came closest was that this problem does not occur in 6.x-1.3 version.
But unfortunately the 6.x-1.3 version does not allow anonymous users.
So my hands are tied.

rogeriodec’s picture

Anyone?

davemaxg’s picture

I had the same problem and found this
specifically:

unset($_REQUEST['destination']);
before drupal_goto() if doesn't work.

which worked for me. I am using hook_flag in a php module, but I would think this should solve your problem if you implement it as a step within rules.

quicksketch’s picture

Priority: Critical » Normal

Probably not a critical bug. I personally don't use the Rules integration, so we'll need a patch for this to be corrected.

grasmash’s picture

For anyone encountering this in Drupal 7, @davemaxg's solution will not work.

Rather than unsetting $_REQUEST['destination'] and calling drupal_goto(), you can just overwrite $_GET['destination']; $_GET['destination'] = '<front>';. Easy enough.

nicodv’s picture

@madmatter23 I have this problem, sorry to ask you, but no good coder here. Could you post the code as it should be published?
And, could I input it directly in php within the rule?

thanks so much

grasmash’s picture

@nicodv The code is just

$_GET['destination'] = 'your/url';

Honestly, I can't remember if I put this in a rule or implemented hook_flag(), but I'd guess that you'll be ok either way.

nicodv’s picture

thanks a lot, I'll give it a try

nico