Closed (fixed)
Project:
Autocomplete Deluxe
Version:
7.x-1.0-beta5
Component:
Multiple values - allow new values
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2012 at 21:38 UTC
Updated:
27 Jun 2012 at 19:51 UTC
Comments
Comment #1
blischalk commentedAfter looking into this issue more I believe that I have found the root of the problem.
I believe by default Drupal form textfields have a 128 character maxlength. (http://api.drupal.org/api/drupal/developer%21topics%21forms_api_referenc...)
Within the autocomplete_deluxe module the widget defines a textfield, hidden through css, that stores ajax data values (autocomplete-deluxe-value-field). Since the autocomplete_deluxe module doesn't specify a maxlength it appears that this field falls back to the Drupal textfields default of 128 characters.
This becomes an issue when large amounts of terms are added in a term reference field or when very large scientific / medical terms are added because this maxlength is quickly reached causing failing validation on node save.
If anyone else encounters this issue I am posting some code that may help ease the problem. The code below alters the autocomplete_deluxe elements info, replacing it's process callback with our own callback. Our callback is exactly the same one the module defines except with our own maxlength for that hidden field defined. This workaround has some issues as this maxlength will apply globally for ALL fields using the autocomplete deluxe widget module.
It would seem that a maxlength should probably be configurable on a per field basis to allow as many characters as necessary. It might even be nice to have some sort counter letting you know how many characters are left and prevent you from adding more terms than you can successfully save.
Comment #2
mastap commentedIndeed, this seems to be the issue.
thanks!
Comment #3
blischalk commentedThe code I posted previously was meant to be added into a custom module. It isn't a patch to fix autocomplete_deluxe but a work around. You would create a custom module and place the code I provided within it renaming any instances of "your_module" with the name of your module.
Comment #4
mzgajner commentedI'm having the same problem. Be kind and assist.
If it helps - this has been fixed for a year and a half in Drupal core:
http://drupal.org/node/971090
Comment #5
ldweeks commentedI'm not sure why the developer of autocomplete_deluxe hasn't created a new release of the code, but this problem has actually already been fixed. I created an issue for it (#1601054: Why not release 7.x-1.0-beta6?), but until he creates a release, you'll have to checkout the updated module from git. Here is the commit that fixes the 128 character limit problem, and here is a link to the beta6 tag in the repository viewer.
Comment #6
MGParisi commentedChange tag to fix as it is already done in GIT. Unfortunately we just have to wait till he creates a new release!
Comment #7
hass commented