Hi,

I am trying to use the widget of autocomplete for allowed values list of this module for suggesting possible values while typing basing on allowed values list. But It does not suggest any possible values from allowed values list even those that have ever used in other nodes which share the same field.

Could this module be modified to show all possible values from allowed values list no matter they ever or never used in other nodes.

Thanks
Nguyen Quoc Viet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markus_petrux’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

You can use the "Autocomplete for allowed values list" widget for any field of type Text or Number with a list of allowed values defined in the field settings. In this case, the autocomplete widget will use the allowed values list to find candidates.

On the other hand, you can use the "Autocomplete for existing field data" widget for any field of type Text. In this case, the autocomplete widget will use existing data for that field in the database to find candidates.

It seems that you're trying to use the "Autocomplete for allowed values list" widget, and maybe it doesn't work for you the way it is supposed to work. In this case, could you please export your content type definition and attach it here?

markus_petrux’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Needs review
FileSize
3.8 KB

Hi,

I believe I've found the problem. It may happen when the field is shared between several content types, and it was first created using a different widget. To solve this, I'm adding the content type name to the autocomplete path, so that we can load the information of the correct widget to compute the candidates. Also, I'm checking the type of the argument $keys used in certain functions internally.

Please, let me know if the attached patch fixes your issue. Thanks.

For the moment, the attached patch seems to work better in my test environment, so I commit that, but I would wait to release a new package for confirmation on whether it also solves your issue.

markus_petrux’s picture

Status: Needs review » Fixed

It's been more than a week with no feedback, so I assume the patch works. I'll wait a few more days before packing a new release, however, just in case something else arises.

markus_petrux’s picture

Status: Fixed » Closed (fixed)

Feel free to re-open if this needs attention. Thanks for reporting.