I have installed the last dev version of the module (7.x-1.x-dev) on Drupal 7.37.

In my template.php I have

function mytheme_preprocess_page(&$variables) {
  $search_box = drupal_get_form('search_form');
  $variables['search_box'] = $search_box;
}

and in the file page.tpl.php:
<div id="search"><?php print render($search_box); ?></div>

In this situation the autocomplete functionality doesn't work.

In the file apachesolr_autocomplete.module there is the function:

function apachesolr_autocomplete_form_search_form_alter(&$form, $form_state) {
  if ($form['module']['#value'] == 'apachesolr_search' || $form['module']['#value'] == 'apachesolr_multisitesearch') {
  $element = &$form['basic']['keys'];
  apachesolr_autocomplete_do_alter($element);
  }
}

The variable $form['module']['#value'] is undefined thereby the autocomplete functionality
not works.
However it works if I write the function so:

function apachesolr_autocomplete_form_search_form_alter(&$form, $form_state) {
  $element = &$form['basic']['keys'];
  apachesolr_autocomplete_do_alter($element);
}

Can someone confirm if it is a bug?
Thanks in advance

Comments

janusman’s picture

Status: Active » Postponed (maintainer needs more info)

Should retry with newer code, or close.