Active
Project:
Top Searches
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2008 at 05:37 UTC
Updated:
24 Oct 2008 at 00:02 UTC
I found that array_merge is not always a safe way to add submit handlers, (if the index matches - it will replace one with the other, rather than keeping them both) I add submit handlers as follows:
if ($form_id == 'search_form' || $form_id == 'search_theme_form') {
$form['#submit']['top_searches_catch_search_keys'] = array();
}
not sure if this change is necessary... just a suggestion
Comments
Comment #1
z.stolar commentedThat's true - array_merge will replace values of existing associative keys, but so will your above suggestion :-)
Comment #2
jenlamptonAh yes, but my above solution will only replace arguments passed to function 'top_searches_catch_search_keys' - it won't mess with anything else in the submit array.
Jen