On Drupal 7 when I post a node I redirect to the specific node created.
I'm searching to redirect to the main admin page when I post correctly the node.
I've tried to put this on template.php:
function node_submit($form, &$form_state) {
$form_state['redirect'] = 'admin';
}
But there was an error on submit:
Fatal error: Cannot redeclare node_submit() (previously declared in /var/www/XXX/modules/node/node.module:1004) in /var/www/XXX/sites/all/themes/XXX/template.php on line xx
If all you want to do is change where a user redirects to after they submit an add node form, from a specific link, there is a much easier way.
Just make your link look like this:
/node/add/[CONTENT-TYPE]?destination=[URL-REDIRECT]
Here is an example that I got working:
/node/add/ic-competencies-toolkit-codes?destination=admin/survey-codes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With