When I create a new field and set the widget to Term reference autocomplete, all works fine.
If I grab an existing field and change the widget type of it, I get JS error on the edit form:
Uncaught TypeError: Cannot call method 'indexOf' of undefined term_ref_autocomplete.js?v=1.0.0:109
This is because the widget tries to get the data from the old autocomplete URL: taxonomy/autocomplete
If I read the field instance info, the autocomplete_path is obviously wrong:
field_info_instance("node", "field_ship_tags", "ship");
[widget] => Array
(
[active] => 0
[module] => term_ref_autocomplete
[settings] => Array
(
[autocomplete_path] => taxonomy/autocomplete
[size] => 60
)
[type] => term_ref_autocomplete_widget
[weight] => 24
)
The expected behavior would be to change the autocomplete path on widget change too.
So the [autocomplete_path] needs to be 'term_ref_autocomplete/autocomplete'
Thanks, and keep the good work, this is a really nice and needed module!
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2101253-term_ref_autocomplete-ajax-path-error.patch | 1.1 KB | arpieb |
Comments
Comment #1
kardave commentedI ran this for all my existing fields.
UPDATE:
Changing back to usual autocomplete neither change the autocomplete_path...
Comment #2
arpieb commentedIt looks like the stock autocomplete widget's AJAX endpoint is getting picked up since it uses the same option name as this module's widget. Since there wound up being no editable setting, I have hardcoded the path into the widget instead of it being a widget setting. Most likely this is cruft from early dev work...
Patch attached that applies against alpha2 fine, also updated in the 7.x-1.x dev branch on commit 42e10e6.
Thanks for catching this and reporting it!
Comment #4
arpieb commentedDeployed on release 1.0-alpha3. Thanks for the contributions!