In privatemsg 6.x-1.3 username autocomplete works only from the beginning of the username. So, if I write "fabio" I do match username "Fabio Varesano" while if I write "varesano" it doesn't match it.

The following patch add support for this.

What do you think?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Version: 6.x-1.3 »

Not sure, one problem is that %string% is quite slow (will be an issue if you have many users).

I am also not sure if it is actually better UX, because while your example is valid, there are also many valid counter examples, if you start typing something like "Sa", you will probably not see names starting with "Sa.." as suggestions but a bunch of totally different names (sorted alphabetically).

So, I'm not sure. Maybe something like "LIKE 'Sa%' OR LIKE '% Sa'", basically, only looking for names that somehow start (first/lastname) with the string we are searching for.

Ideas?

Anyway, no new features or changes are added to the 6.x-1.x branch. The patch probably doesn't apply against 6.x-2.x.

Berdir’s picture

Status: Needs review » Needs work

The last submitted patch, privatemsg_autocomplete_username_not_only_from_beginning.patch, failed testing.

Berdir’s picture

Ok, the patch applies but doesn't work anymore as the tests expect it to.

oadaeh’s picture

Version: » 6.x-2.x-dev
Issue summary: View changes
Status: Needs work » Closed (won't fix)

This issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-1.x branch (bug fixes only) or the 7.x-2.x branch.
Thank you.