I am using PHP code to populate the allowed values list. The php code uses an external enterprise api to match on user names.
The api returns all the matching names. However before showing the names to the user, the autocomplete module calls -
autocomplete_widgets_json() -> _autocomplete_widgets_get_options() -> _autocomplete_widgets_get_options_allowvals()

The _autocomplete_widgets_get_options_allowvals() function uses the autocomplete match criteria and only has options of 'contains', 'equals' and 'starts with'.

This is truncating some of my results. I am planning to write a patch to bypass this check by providing an 'ignore' option which will allow us to show all values.

Please advise.

My use case: I want to search for James Cameron. When I type jamesc I find the match since James Cameron contains jamesc.
However when I search on 'cameronj', my service returns James Cameron but this function prevents it from being listed since James Cameron does not contain 'cameronj'.

CommentFileSizeAuthor
#2 autocomplete_widgets.patch2.21 KBmanasiv
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

manasiv’s picture

Reposting the use case:

My use case: I want to search for James Cameron. When I type james[SPACE]C I find the match since James Cameron contains james[SPACE]c.
However when I search on 'cameron[SPACE]j', my service returns James Cameron but this
function prevents it from being listed since James Cameron does not contain 'cameron[SPACE]j'.

manasiv’s picture

FileSize
2.21 KB

Attaching the patch. The patch adds an option 'ignore' to the autocomplete widgets field. If this is selected, it will not filter the returned matches.