ckan / ckanext-scheming

Easy, shareable custom CKAN schemas
Other
83 stars 161 forks source link

Upgrade to v3 API for tag_autocomplete #224

Open howff opened 4 years ago

howff commented 4 years ago

The tag autocompletion currently uses the old util API. Changing the presets.json from: "data-module-source": "/api/2/util/tag/autocomplete?incomplete=?" to "data-module-source": "/api/3/action/tag_autocomplete?query=?" won't work because the former returns ResultSet[Result] and the latter returns result.

I see the parseCompletions code in ckan/public/base/javascript/client.js var raw = jQuery.isArray(data) ? data : data.ResultSet && data.ResultSet.Result || {}; but when I change it to raw = data.result it doesn't work. Any tips?

howff commented 4 years ago

Using a workaround https://github.com/ckan/ckan/pull/5071 doesn't completely solve the problem, it would be good to have this implemented properly, if someone has some suggestions?