I ran into this because I needed to override the submit handler of a custom search form, but found that I couldn't. Although I was being nice and simply hooking in my own submit handler to override custom_search's submit handler I found that I was being trumped by yet another submit handler. that's because of this code block in custom_search_form_alter
<?php
// Form attributes
$form['#attributes']['class'] = array('search-form');
$form['#submit'][] = 'custom_search_submit';
It could be this and then it will only have the submit handler registered once:
// Form attributes
$form['#attributes']['class'] = array('search-form');
if (!in_array('custom_search_submit', $form['#submit'])) {
$form['#submit'][] = 'custom_search_submit';
}
Comments
Comment #1
cosmicdreams commentedHere's the patch.
Comment #2
cosmicdreams commentedComment #3
jdanthinne commentedSeems ok for me. Pushed to DEV.
Thanks!