In the following code custom call back function is being printed twice. How to prevent submit call back function being called twice.
function my_module_form_alter(&$form, &$form_state, $form_id){ if ($form['#id'] == "views-exposed-form-test-page"){ $form['#submit'][] = 'custom_callback'; } } function custom_callback($form,&$form_state){ $form_state['redirect'] = false; dpm("insert record"); }
hook_form_alter()firing twice resulting in the custom callback firing twice? Or is thehook_form_alter()being fired once, and the custom function is firing twice?dpm($form_id);inside yourhook_form_alter(&$form, $form_id), do you get different form ID's?