If I want a custom submit handler, the usual answer is to add the function call to $form['#submit'], and if need be, $form['actions']['submit']['#submit']. The standard warning is do something like
because you generally want the form submission to still go through the core form submission handlers.
I have a case where I need to completely manage the form submission process and don't ever want the form to be passed to the core submission handlers. To test that I could do this, I have:
global $user; module_load_include('inc', 'node', 'node.pages'); $node_form = new stdClass; $node_form->type = 'my_content_type'; $node_form->uid = $user->uid; $node_form->name = (isset($user->name) ? $user->name : ''); $form = drupal_get_form('my_content_type_node_form', $node_form); $form['#submit']=''; $form['actions']['submit']['#submit']=''; $render($form);
I would have thought that since there are no submission handlers, the form shouldn't submit, or even if the page reloaded due to the action attribute in the html form element, that the content wouldn't be added to the database.
But it is.
So how can I keep Drupal from processing a submission through the normal core submission handlers, but still process through custom handlers? (I already know how to write custom form submission handlers, so that's not part of this question.)