I've setup one of my forms to redirect to a thank you page, however it keeps trying to show the node that was just created, and because users aren't allowed to see that node type, get an access denied message...

I've got two custom destinations setup, one works, the newer one doesn't. Both point to to the same thank you page. Could that be the reason?

Comments

Anonymous’s picture

Priority: Normal » Critical

Correction, neither of my forms are redirecting... I even tried changing the page they redirect to, still can't get it to work.

Anonymous’s picture

I checked the code and it seems my custom destination page is being correctly added to the form's #redirect key, something must be stopping it redirecting after that...

Anonymous’s picture

But it does work when I try to delete a node - it redirects instead of deleting it...
I have to delete nodes from '/admin/content/node'.

kangaroobin’s picture

anything?

Anonymous’s picture

Status: Active » Closed (fixed)

I'm no longer using this module so am closing this issue for now. Anyone else experiencing this same issue should feel free to re-open it with details about their specific problem, setup, etc.

dries arnolds’s picture

I've got exactly the same thing. Settings are ok, but I still get redirected to the submitted node.

Maybe it's a conflicting module? Pathauto? Global redirect?

dries arnolds’s picture

Status: Closed (fixed) » Active
flevour’s picture

Could you please list some steps to reproduce the bug?
Thanks,
Francesco

jbizzay’s picture

I tried adding a $form['#redirect'] to my node/edit forms, and found that when there is a ?destination= parameter set in the url, that the destination always takes precedence over what is set in the form array. I looked at this module to see if it handled this situation or not. Looks like it doesn't, and I'm pretty sure that the url destination is what is the problem. Maybe this module should rewrite links to the form itself?

jbizzay’s picture

I ended up just setting $_REQUEST['destination'] to where I wanted it to redirect in my custom form submit handler, and it works great now.

odyseg’s picture

Category: support » task
Priority: Critical » Major
Status: Active » Needs review

I had the nodevote module installed on my localhost installation of drupal. I've created a left side block and put the nodevote form there by using the drupal_get_form(). When pressing the submit for voting, it redirects me to the page of the node, so I supposed I could use the custom (form) destination module to instead redirect me to the front page when voting. Sad to say, it's not redirecting me to the front page. The form id for the said nodevote form is 'nodevote_rate_form'.

Paul-Hickman-GBW’s picture

Version: 6.x-1.4 » 6.x-1.6

I have installed this to redirect my user-register process to a newly created page and it simply doesn't work. I have tried accessing the new page directly which works fine and double-checked the id of the form using Firebug which it shows as "user-register"

Any ideas on how to troubleshoot this would be much appreciated.

wadmiraal’s picture

Up. Got the same issue here.

Jorenm’s picture

I had problems getting this module to work on the user creation pages. I had success with unsetting the 'destination' form key in a hook_form_alter. Having to have a hook_form_alter to get this module to work on some forms half defeats the purpose, but there it is.

rob c’s picture

    // Unset the destination if one exists,
    // else the redirection will fail.
    if (isset($_GET['destination'])) {
      unset($_GET['destination']);
      // The request_path() is introduced in D7.
      // drupal_goto(request_path());
      // But $_GET['q'] works fine in D6 i guess.
      drupal_goto($_GET['q']);
    }

Seems to work great in Drupal 7, it may also work for D6 with $_GET['q'].
Placed inside the check that looks if the form has a customdestination set in the database that's run inside hook_form_alter(). Might also want to code an extra option column in the db, 'override get destination url' or something, so people can choose. (although if you set a customdestination, i asume you want that to work, so might be a bit overkill to make that selectable, maybe it would make sense if there's also an option to select roles...)