Callback on 'save' on 'new node form' doesn't fire UPDATE: 
Approach showed bellow has the same results -> doesn't work.

$new_form['#submit'][] = '_fmu_new_firm_under_user';


Separate button with only that callback doesn't work either. And what's weird, even if it has only the '_fmu_new_firm_under_user' callback it actually works the same way as 'save' button -> it saves the node and doesn't fire my callback.

$new_form['actions']['submit_and_create'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; t('Vytvořit firmu'),
    '#submit' =&gt; array('_fmu_new_firm_under_user'),
  );


Original message

I've created a page with a 'myContentType_node_form' and attached a callback to the save button. The problem is that the callback is not fired when I press the button. To be more specific the default callback is fired - the node is saved - but my callback is not fired.

function _fmu_register_new_user_firm_callback($uid, $control_hash) { //a callback function for a menu item
      include_once(drupal_get_path('module', 'node') . '/node.pages.inc' );
      $new_form = node_add('fm_firm');
      $new_form['uid']['#value'][] = $uid;

      $new_form['actions']['preview']['#access'] = false;
      $new_form['actions']['submit']['#submit'][] = '_fmu_new_firm_under_user';

      dsm($new_form);
      return $new_form;
  }

function _fmu_new_firm_under_user($form, &amp;$form_state) {

  $user = user_load($form['uid']['#value']);
  $user-&gt;fmu_users_firm[LANGUAGE_NONE][0]['target_id'] = $form-&gt;nid;
  user_save($user);

  dsm($user);
}


DSM of the form before returning it:

actions (Array, 16 elements)

    #type (String, 7 characters ) actions
    submit (Array, 23 elements)
        #type (String, 6 characters ) submit
        #access (Boolean) TRUE
        #value (String, 4 characters ) Save
        #weight (Integer) 5
        #submit (Array, 2 elements)
            0 (String, 16 characters ) node_form_submit | (Callback) node_form_submit();
            1 (String, 24 characters ) _fmu_new_firm_under_user | (Callback) _fmu_new_firm_under_user();
        #input (Boolean) TRUE
        #name (String, 2 characters ) op
        #button_type (String, 6 characters ) submit
        #executes_submit_callback (Boolean) TRUE
        #limit_validation_errors (Boolean) FALSE
        #process (Array, 1 element)
        #theme_wrappers (Array, 1 element)
        #defaults_loaded (Boolean) TRUE
        #tree (Boolean) FALSE
        #parents (Array, 1 element)
        #array_parents (Array, 2 elements)
        #processed (Boolean) TRUE
        #required (Boolean) FALSE
        #attributes (Array, 0 elements)
        #title_display (String, 6 characters ) before
        #id (String, 11 characters ) edit-submit
        #ajax_processed (Boolean) FALSE
        #sorted (Boolean) TRUE
    preview (Array, 23 elements)
    #theme_wrappers (Array, 1 element)
    #process (Array, 2 elements)
    #weight (Integer) 100
    #defaults_loaded (Boolean) TRUE
    #tree (Boolean) FALSE
    #parents (Array, 1 element)
    #array_parents (Array, 1 element)
    #processed (Boolean) TRUE
    #required (Boolean) FALSE
    #attributes (Array, 1 element)
    #title_display (String, 6 characters ) before
    #id (String, 12 characters ) edit-actions
    submit_and_create (Array, 3 elements)
        #type (String, 6 characters ) submit
        #value (String, 15 characters ) Vytvořit firmu
        #submit (Array, 1 element)
            0 (String, 24 characters ) _fmu_new_firm_under_user | (Callback) _fmu_new_firm_under_user();
You would be better off using hook_node_submit which would fire when any node is submitted.

You can make it specific to your node by the following:

function MODULE_node_submit($node, $form, &amp;$form_state)
{
    if ($node-&gt;type == "NODE-TYPE")
    {
        //do stuff
    }
}