Hello,

There is a small issue when searching for a username in autocomplete.
Only usernames that are starting with the keyword are returned.

Here's is a patch that will return usernames that contains the keyword.

Comments

Title:Search automcompleteSearch autocomplete

Title:Search autocompleteUsername search autocomplete

StatusFileSize
new747 bytes

Sorry,

Previous patch doesn't work as expected.
Try this one instead :

Version:6.x-1.7» 6.x-1.x-dev
Status:Active» Needs review

Your patch changes search to starting with... as for me this makes no sense because this regression from current functionaly.

I'm not sure to understand what you say.

This patch allows searching usernames that contain the keyword rather than starting with the keyword.

Let's say we have a john.smith username.

Before, if I typed smith, I found nothing.
With this patch, you would find john.smith.

Status:Needs review» Needs work

+++ b\masquerade.module
@@ -555,7 +555,7 @@
-  $result = db_query_range("SELECT u.name FROM {users} u WHERE LOWER(u.name) LIKE LOWER('%%%s%%')", $string, 0, 10);
+  $result = db_query_range("SELECT u.name FROM {users} u WHERE LOWER(u.name) LIKE LOWER('%s%%')", $string, 0, 10);

but your batch suggests %s%% whick means starting with

StatusFileSize
new747 bytes

Oh, sorry, my mistake.
I inverted the two files.

Here it is :

Title:Username search autocompleteChange Username search autocomplete to - contains string
Status:Needs work» Needs review

Re-titled and makes sense so let's get more reviews

Category:bug» feature

this change should be ported to 7.x first and require review of other mainteiners

Status:Needs review» Needs work

I'll commit stuff that for 7 with no 6 patch, but not the other way around.