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

dolu’s picture

Title:Search automcomplete» Search autocomplete
dolu’s picture

Title:Search autocomplete» Username search autocomplete
dolu’s picture

StatusFileSize
new747 bytes

Sorry,

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

andypost’s picture

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.

dolu’s picture

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.

andypost’s picture

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

dolu’s picture

StatusFileSize
new747 bytes

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

Here it is :

andypost’s picture

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

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

andypost’s picture

Category:bug» feature

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

deekayen’s picture

Status:Needs review» Needs work

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