I have a Views with an exposed filter block and put the block on the front page.
I use the following code to add a custom submit handler.
function mymodule_form_alter(&$form, &$form_state, $form_id) {
if($form_id == 'views_exposed_form' )
{
array_unshift($form['#submit'], 'manage_custom_filters');
}
}
function manage_custom_filters($form, &$form_state) {
dpm($form['#id']); // output views name
}
Here is the question, whenever i load the front page, the manage_custom_filters get called, i suppose it will be called only when i submit the exposed filter form?
I did the same thing for node form submit, it does not behave like the views exposed filter form. manage_custom_filters only get called when i submit the form.
Is this the correct behavior of views exposed filter form?
How do i differentiate the manage_custom_filters is get called by 'on load' or submit action?