I am having a problem connecting a custom submit handler to a form. I am trying to switch off redirecting after the save of an eck entity on edit form. But i am not getting that far as my submit handler is not getting called.
The first debug log is as you would expect original handler and my custom one returned (so the alter part seems fine), but my on submit debug is never displayed on submission. I have switched the same code to the user_profile_form and it works fine, both debug logs coming through as expected. Why would this form be different??
Code:
function mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'eck__entity__form_edit_myentity') {
$form['#submit'][] = 'mymodule_eck_ent_submit';
dd($form['#submit']);
}
}
function mymodule_eck_ent_submit($form, &$form_state)
{
dd("smashed in !!");
}
Many Thanks Mathew
$form['actions']['submit']['#submit'][] = 'mymodule_eck_ent_submit';