I have tried to search for solution to this for quite a while now.
I am writing a D7 version of the FAQ Ask module and are stuck on the issue where I'm trying to redirect users to a custom page after posting a node creation form.
The module allows users (both anonymous and registered) with the
ask question and
create faq content permissions to create an unpublished node with a title and a custom field set - but not the body field. These users are not allowed to view the unpublished node, but should be redirected to a custom page when posting a question.
Regardless it seems of what I set the redirect attribute of the
$form_state to, the user is redirected to the
'node/[nid]' of the newly created (but unpublished) node resulting in a Access Denied error displayed.
See further details in the issue #1554912: Access Denied for Anonymous comment #3 detailing the code where this is handled.
I can see that even if I set
$form_state['redirect'] = array('faq-page'); // Redirect to faq-page if the user is not allowed to view content when I evaluate what is happening in
drupal_redirect_form(), then the redirect path is set back to