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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nielsonm’s picture

Created a patch to use the privatemsg_name_lookup_matches alter to exclude non-connected users.

jhedstrom’s picture

Status: Active » Needs review
FileSize
1.5 KB
2.24 KB

There 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.

Status: Needs review » Needs work

The last submitted patch, 2: privatemsg-alter-hook-2273647-02.patch, failed testing.

jhedstrom’s picture

Status: Needs work » Needs review
FileSize
898 bytes
2.24 KB

And apparently some undefined variable exceptions when that first variable_get doesn't evaluate to true.