How to add a custom Save &  button to Node Add/Edit form? I added the following code in hook_form_alter() and I get my button on the Add/Edit node form:

$form['actions']['save_add_lesson'] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; 'Save &amp; Add a Lesson',
  '#name' =&gt; 'op',
  '#submit' =&gt; array('mymodule_node_form_submit'), /* NEED this */
  '#weight' =&gt; 1000
);


But, clicking the button doesn't seem to hit hook_node_submit() or hook_node_insert(). I'm assuming I'm missing a hook or something in the button creation...anyone have any ideas?



Then added this function:

function mymodule_node_form_submit($form, &amp;$form_state) {
  // Do stuff before saving the node

  // Call this to save the node
  node_form_submit($form, $form_state);

  // Do stuff after saving the node
}
Got it :D

Adding

'#submit' =&gt; array('mymodule_course_form_submit'),


To the submit button worked. Like this:

$form['actions']['save_add_lesson'] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; 'Save &amp; Create a Lesson',
  '#name' =&gt; 'op',
  '#submit' =&gt; array('mymodule_course_form_submit'),
  '#redirect' =&gt; 'node/add/lesson',
  '#weight' =&gt; 1000
);

function mymodule_course_form_submit($form, &amp;$form_state) {
    $nid = mymodule_node_save_no_redirect($form, $form_state);  

    $form_state['redirect'] = 'node/add/lesson';
    unset($_GET['destination']);
    drupal_static_reset('drupal_get_destination');

    if($nid != -1) {
        $_SESSION['mymodule_course_nid'] = $nid;
        drupal_redirect_form($form_state);      
    } else {
        // Failed to save Course...notify user
        drupal_set_message('Failed to save Course Content', 'error');
    }
}