When I attempt to set a default value for an autocomplete text field, the default setting is not saved or used. Default settings still work fine on my non-autocomplete text fields. The autocomplete widgets are super-useful, but I need to set default values for some of these fields, so I hope this can be fixed. Thank you for your time!

Comments

markus_petrux’s picture

Status: Active » Needs review

Could you please try the following change to function autocomplete_widgets_validate() in autocomplete_widgets.module:

-  $value = trim($form_state['values'][$field_name][$delta][$field_key]);
+  $value = trim($element['#value']);

This change could potentially affect the fields in the node edit form as well. I haven't had the time to test this much, so this needs as much testing as possible with text and number fields.

markus_petrux’s picture

Status: Needs review » Closed (won't fix)

Won't fix without further feedback.

markus_petrux’s picture

Status: Closed (won't fix) » Fixed

I've been testing the fix in #1 for a while and it seems to cause no harm. Committed to CVS.

Status: Fixed » Closed (fixed)

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