Download & Extend

Change Username search autocomplete to - contains string

Project:Masquerade
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
masquerade-autocomplete.patch745 bytesIgnored: Check issue status.NoneNone

Comments

#1

Title:Search automcomplete» Search autocomplete

#2

Title:Search autocomplete» Username search autocomplete

#3

Sorry,

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

AttachmentSizeStatusTest resultOperations
masquerade-autocomplete.patch747 bytesIgnored: Check issue status.NoneNone

#4

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.

#5

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.

#6

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

#7

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

Here it is :

AttachmentSizeStatusTest resultOperations
masquerade-autocomplete.patch747 bytesIgnored: Check issue status.NoneNone

#8

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

#9

Category:bug report» feature request

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

#10

Status:needs review» needs work

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