Custom submit handler on node form not picked up I am altering a node form with hook_form_alter and adding a couple of submit handlers. When the form gets submitted they get picked up using:

foreach (array_keys($form['actions']) as $action) {
  if ($action != 'preview' &amp;&amp; isset($form['actions'][$action]['#type']) &amp;&amp; $form['actions'][$action]['#type'] === 'submit') {
    array_unshift($form['actions'][$action]['#submit'], 'submit_handler_a');
    $form['actions'][$action]['#submit'][] = 'submit_handler_b';
  }
}


Problem is, if the form contains a field that can store multiple values, as soon as I click on the 'Add more' button for that field and a new value for it, when submitting the form my handlers are not being picked up.

What am I doing wrong?
Have a look on those form elements in the form array. They might have their own ['#submit'] in the array and you might need to add your custom handler on those too