Autocomplete was getting sluggish, and I discovered that the callback was returning ALL results. The limit was not being respected.
It appears the url structure set by Ajax and the arguments passed on to the callback do not match.
In autocomplete_deluxe.js:
var url = settings.uri + '/' + self.limit + '/' + term;
In autocomplete_deluxe.module:
function autocomplete_deluxe_taxonomy_callback($field_name, $tags_typed = '', $limit = 10) {
$args = array_slice(func_get_args(), 2);
$tags_typed = implode('/', $args);
}
A sample ajax request to this url http://localhost/autocomplete_deluxe/taxonomy/field_tags/10/examp?term=e... will set the arguments:
While the $tags_typed is later set to the correct value using func_get_args
, I think this should not have been necessary if the arguments were set properly.
The limit in this case is set to a non-numeric value and does not get used by the query builder. Hence, the query will return ALL results.
Also, the callback seems to be doing some weird trick with the $tags_types
variable, which I think, is completely unnecessary here.
I have taken the liberty to refactor the callback with a patch.
Closed: outdated
2.2
Code (miscellaneous)
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.