Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
janusman CreditAttribution: janusman at Acquia commentedShould retry with newer code, or close.