On my site I have two autocomplete_deluxe instances in a form. On submission of the form, the value returned for each was the same. It seems that this is caused by each element containing a ['textfield'] and ['value_field'] item.

My quick and dirty solution was to replace all instances of
$element['textfield'] and $element['value_field'] in autocomplete_deluxe.module with $element['textfield_' . $element['#title']] and $element['value_field_' . $element['#title']].

This seems to work for now, and for my specific use case, but feels fairly hacky so I'm not submitting a patch.

Comments

andykisaragi’s picture

Looking closer I suppose you'd have to do the same with $element['list_value'].

sepgil’s picture

Please use the dev version, I thing it's much more stable than the beta5... :P

emptyvoid’s picture

Component: Code » Single values - allow new values
Status: Active » Reviewed & tested by the community

Confirmed, upgrading to the dev release the error and issue does not occur any longer.

johnv’s picture

Status: Reviewed & tested by the community » Fixed

so this is fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jwjoshuawalker’s picture

Version: 7.x-1.0-beta5 » 7.x-1.x-dev
Status: Closed (fixed) » Active

I am using form_alter to use this widget as a Views exposed filters. Using only 1 widget works great. 2 or more as exposed filters on the same view does not.

Looks like this in the form_alter:

    $form['tags'] = array(
      '#type' => 'autocomplete_deluxe',
      '#autocomplete_deluxe_path' => url('autocomplete_deluxe/taxonomy/field_tags', array('absolute' => TRUE)), 
      '#multiple' => TRUE,
      '#autocomplete_min_length' => 0,
      '#autocomplete_multiple_delimiter' => ',',
    );

The other one only varies in the name & taxonomy vocabulary used.

When submitted, each field submits &textfield=&value_field=Chosen Tags. So that winds up twice in the URL, the latter one overriding anything.

I've tried using a custom views-exposed-form--VIEW.tpl.php and changing the name="value_field" from the "autocomplete_deluxe values" hidden input but the view doesn't recognize the filter input when I do that.

This happened with the beta5 or dev versions.

LNakamura’s picture

Component: Single values - allow new values » Single values
Issue summary: View changes
Status: Active » Closed (outdated)

Hi, @drastik - I just modified a view so that I have 2 Autocomplete Deluxe exposed filters, and don't see any problems. The 2 filters both function and refine the results as expected. I'm running the latest 2.x dev code for Autocomplete Deluxe.

I'm closing this as outdated, but if you or anyone else still encounter problems w/ multiple AD exposed filters, let me know and I'll re-open this issue.

Thanks!