Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a site that uses the realname module and has users that have duplicate realnames. While the ajax autocomplete only shows users with whom I am connected, the name lookup doesn't exclude users to whom I am not connected. Furthermore, since the default functionality for privatemsg is to print all the duplicates and let the user sort them out, this doesn't land itself to a great UX.
Comment | File | Size | Author |
---|---|---|---|
#4 | privatemsg-alter-hook-2273647-04.patch | 2.24 KB | jhedstrom |
Comments
Comment #1
nielsonm CreditAttribution: nielsonm commentedCreated a patch to use the privatemsg_name_lookup_matches alter to exclude non-connected users.
Comment #2
jhedstromThere was a bug in the above patch where names coming through in the form of
REALNAME [user: USERNAME]
weren't working. This updated patch checks for that pattern and then modifies the query if both realname and username are available.Comment #4
jhedstromAnd apparently some undefined variable exceptions when that first variable_get doesn't evaluate to true.