Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When no search terms are present, search_config doesn't kick in.
I just patched search_config's form_alter in my version to let it.
// if (arg(1) == 'node') {
if (arg(0)=='search') {
The reason is that I like to expand the advanced search form when users just hit the search button (code below for anyone interested).
In your helper module's form_alter:
switch ($form_id) {
case 'search_form':
if (!arg(1)) { // if it's only /search and no keywords, expand the advanced search fieldset
$form['advanced']['#collapsed']=FALSE;
}
break;
}
Comments
Comment #1
darkodev CreditAttribution: darkodev commentedOops, that wasn't good. Doesn't let search_config kick in when using search 404. Better to remove the arg(1) condition altogether.
Comment #2
canen CreditAttribution: canen commentedI see no immediate harm in doing this. Committed in http://drupal.org/cvs?commit=216036.
Comment #3
darkodev CreditAttribution: darkodev commentedThanks, canen!
Comment #4
canen CreditAttribution: canen commenteddhrgovic,
Sorry to disappoint but I will need to revert this since it breaks the search forms on none node search types. See http://drupal.org/node/477802
I'll see if there is another way to easily implement it.
Comment #5
Alan D. CreditAttribution: Alan D. commentedFixed in D7
Comment #6
Alan D. CreditAttribution: Alan D. commentedComment #7
Alan D. CreditAttribution: Alan D. commentedRelated task suggested by canen is closed and the code here is no longer applicable.