[buddypress-trac] [BuddyPress] #5155: Messaging: ajax autocomplete does not work if users want to send an email to users login name

buddypress-trac noreply at wordpress.org
Tue Aug 27 21:51:57 UTC 2013


#5155: Messaging: ajax autocomplete does not work if users want to send an email
to users login name
--------------------------+-----------------------------
 Reporter:  quan_flo      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:  1.8.1
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 Many sites use the login name and do not display the real name of a user.

 If you want to write a message to another user, autocompleter will not
 work with login-name.

 I'd love to see this feature included in buddypress, so I modified the
 code of bp-core-classes.php

 Line 1101 and 1102 were modified:

 {{{
                 $total_users_sql = apply_filters(
 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM
 {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID =
 pd.user_id WHERE {$status_sql} AND (pd.value LIKE '%%{$search_terms}%%' OR
 u.user_login LIKE '%%{$search_terms}%%') ORDER BY pd.value ASC",
 $search_terms );
                 $paged_users_sql = apply_filters(
 'bp_core_search_users_sql',       "SELECT DISTINCT u.ID as id,
 u.user_registered, u.user_nicename, u.user_login, u.user_email FROM
 {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID =
 pd.user_id WHERE {$status_sql} AND (pd.value LIKE '%%{$search_terms}%%' OR
 u.user_login LIKE '%%{$search_terms}%%') ORDER BY pd.value ASC{$pag_sql}",
 $search_terms, $pag_sql );
 }}}

 user_login was added to the query.

 If you have concerns if everybody wants to have this, you could user a
 define that can be set in bp-custom.php for example.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5155>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list