Hi,

I have a normal text field in a content type of max length 255 char. It is set to "autocomplete for existing field data". If I try to enter more than 128 characters, I am unable to. The cursor just stops. It works fine without the autocomplete widget setting. It doesn't necessarily need to autocomplete after that limit, but the user needs to be able to add extra text. Any help much appreciated.

CommentFileSizeAuthor
#5 1480526-fix.patch664 bytesbleen
#1 1480526.patch2.01 KBbleen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
2.01 KB

The attached patch should fix this issue ... anyone want to take it for a spin before I commit? (NOTE: 90% of this patch is removing whitespace where needed)

bleen’s picture

Status: Needs review » Needs work
+++ b/autocomplete_widgets.moduleundefined
@@ -115,8 +115,9 @@ function autocomplete_widgets_field_widget_form(&$form, &$form_state, $field, $i
+    '#maxlength' => $field['settings']['max_length'],

This is the line that really matters

bleen’s picture

Status: Needs work » Needs review

oops .. didnt mean to change the status yesterday

bleen’s picture

Status: Needs review » Fixed

This ended up being trivial enough to fix that I went ahead and committed.

bleen’s picture

FileSize
664 bytes

DOH! .. So of course my impatience got the better of me.

If you used autocomplete widgets using predefined values, then the patch in #1 causes an error.

I've committed this patch to rectify...

Status: Fixed » Closed (fixed)

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