The version of masquerade we are using only allows us to search by the beginning of the email address. We would like to search by any part of the email or by user name. Would this be possible to put in as a feature request?

Comments

maxplus’s picture

Issue summary: View changes

Yes,

that would be cool for me too.
Now I think the current search is looking only to the first word of the username

leendertdb’s picture

Title: Allow the Admin masquerade search box to search for any part of the email instead of searching only the beginning. » Allow the Admin masquerade search box to search on both email address and username.
Version: 7.x-1.0-rc4 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.59 KB

I have added a patch which changes the SQL query to search on both the username and the email address as full wildcards (%string%), instead of only searching on the beginning of the username (string%).

In our usecase usernames are automatically generated based on the email address the customer enters, so it makes more sense to search on both usernames and email addresses.

I don't think making this change breaks anything since it justs introduces additional functionality, but if it's considered too broad we could always add an admin setting page where the administrator can choose the search method for the masquerade block.

sreenivasparuchuri’s picture

For Druapl 8 version

I created new module where I had extended the masquerade, so that now we can able to search with role,email,user id,username

Masquerade Extra

andypost’s picture

I'm sure better to allow autocomplete to use view and create UI for that instead of hacking the query all the time

hargobind’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #2 works great! I came here to submit something similar, but this is better than the one mine. I really like the addition of showing the email after the username.

ressa’s picture

Status: Reviewed & tested by the community » Closed (outdated)

Thanks everyone for working on this. In an attempt to help the maintainers, I am going through some of the Drupal 7 issues, and closing them, since Drupal 7 is EOL.

Maintainers should grant credit for the great work to the relevant users, even if the patch did not get committed: https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett....

Since Drupal 7 is EOL and search seems not available in Drupal 11, we can probably close this issue, but feel free to re-open if this is still relevant, or we should consider adding this feature to Drupal 11?

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.