Hi,
I want to redirect my form after submissions, I'm trying to use a hook, but this is what I get:
function node_form_submit(&$form, $form_state) {
$form_state['redirect'] = 'contentManager/';
}
Fatal error: Cannot redeclare node_form_submit() (previously declared in drupal/modules/node/node.pages.inc:451) in drupal/sites/all/themes/bluemarine/template.php on line 31
I'm using the module name "node" for my hook. I guess this is wrong, but I don't understand why
Update: Ok, I'm not developing a new module. I've added the function to template.php in my Bluemarine template.
function bluemarine_form_alter(&$form, $form_state) {
$form_state['redirect'] = 'contentManager/';
}
Bluemarine is the name of my theme.. "contentManager" is a page I've created in my backend with a View with all nodes.
This function is completely ignored.
Update2 Ok, so now, this is my current template.php file (I'm sure phptemplate_node_form is invoked)
function phptemplate_node_form($form) {
$form['#submit'][] = 'myFormSubmit';
}
function myFormSubmit() {
echo "hello";
die();
}
The function myFormSubmit is not invoked.
thanks