Active
Project:
Apache Solr Autocomplete
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Dec 2012 at 09:51 UTC
Updated:
23 May 2014 at 03:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nicja commentedThanks for this.
I had to change the function apachesolr_autocomplete_do_alter on line 74 in apachesolr_autocomplete.module to set $element['#attributes']['class'] to a string instead of an array, in order to get the custom widget to work.
If $element['#attributes']['class'] is set as an array the class 'Array' is applied to the element insted of 'apachesolr-autocomplete unprocessed'
This is for a site running drupal 6.26
Comment #2
soulfroysHello @dhuygelaere!
Thank you for your code, works great! I just noticed that is not working in blocks...
Do you have this problem too?
I'm using:
- Apache Solr Search 6.x-3.x-dev (2013-Sep-16)
- Solr 4.4
Comment #3
Funksmaname commentedThanks for this - working on search page - but as soulfroys said, not working on the search block... any advice??
Comment #4
Funksmaname commentedAlso, this module is causing a 'security update available' warning on the site...?
Comment #5
kaythikhaing07 commentedThanks @n.dhuygelaere. I changed apachesolr_autocomplete_do_alter() on you source code and fixed for appearing on block and theme form.
function apachesolr_autocomplete_do_alter(&$element) {
if (apachesolr_autocomplete_variable_get_widget() == 'custom') {
// Create elements if they do not exist.
if (!isset($element['#attributes'])) {
$element['#attributes'] = array();
}
/*update START*/
if (!isset($element['#attributes']['class'])) {
$element['#attributes']['class'] = 'apachesolr-autocomplete unprocessed';
}
else {
$element['#attributes']['class'] .= ' apachesolr-autocomplete unprocessed';
}
/*update END*/
}
else {
$element['#autocomplete_path'] = 'apachesolr_autocomplete';
}
}