I’ve done the cursory googling, but so far I haven’t found anything close to an answer for this.
I’m using the Masquerade module with a custom module on top to extend it and make its searching algorithms a bit more "clever" (Soundexes, custom fields and such), and it returns the results in a certain order, passed through to drupal_json_output()
. However, because JSON isn’t exactly indexed, it means that when the autocomplete text field picks it up, it’s in a slightly screwy order based on its keys (which are the users’ usernames). I can forcibly send a array_values()
to the JSON output, but it breaks Masquerade’s functionality as it requires the username to be the key. I’d imagine this would be a problem with other autocompletion stuff in Drupal that uses JSON loads.
Can anyone suggest a way of doing this please? I’m not sure whether it’s a matter of Masquerade or of D7’s textfield autocompletion.
Thanks