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';
        }        
CommentFileSizeAuthor
#1 1909050_2.patch694 bytescosmicdreams
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cosmicdreams’s picture

FileSize
694 bytes

Here's the patch.

cosmicdreams’s picture

Status: Active » Needs review
jdanthinne’s picture

Status: Needs review » Fixed

Seems ok for me. Pushed to DEV.
Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.