Error searching member in group
-
HI,
When i search for a member in a group (/groups/grupo/members/), occurs this error:
[Unknown column ‘u.user_id’ in ‘IN/ALL/ANY subquery’]
SELECT u.ID as id FROM adwp_users u WHERE 1=1 AND u.ID IN (27412,304,509,6625) AND u.user_id IN ( SELECT ID FROM adwp_users WHERE ( display_name LIKE ‘%ar%’ OR user_login LIKE ‘%ar%’ ) ) ORDER BY FIELD(u.id,27412,304,509,6625) LIMIT 0, 20
[Unknown column ‘u.user_id’ in ‘IN/ALL/ANY subquery’]
SELECT COUNT(u.ID) FROM adwp_users u WHERE 1=1 AND u.ID IN (27412,304,509,6625) AND u.user_id IN ( SELECT ID FROM adwp_users WHERE ( display_name LIKE ‘%ar%’ OR user_login LIKE ‘%ar%’ ) )
In log we have “do_action(‘wp_ajax_bp_get_suggestions’), WP_Hook->do_action, WP_Hook->apply_filters, bp_ajax_get_suggestions, bp_core_get_suggestions, BP_Groups_Member_Suggestions->get_suggestions, BP_User_Query->__construct, BP_User_Query->do_user_ids_query”I check the SQL and changing the field name “… AND u.user_id IN ( SELECT ID FROM adwp_users …” by “… AND u.ID IN ( SELECT ID FROM adwp_users …” fix it.
So, in /plug-ins/buddypress/bp-core/classes/class-bp-user-query.php file, on line 346, changing:
$sql[‘where’][] = “u.{$this->uid_name} IN ( SELECT ID FROM {$wpdb->users} WHERE ” . bp_core_get_status_sql( ” ) . ” )”;
to:
$sql[‘where’][] = “u.ID IN ( SELECT ID FROM {$wpdb->users} WHERE ” . bp_core_get_status_sql( ” ) . ” )”;The message error is solved.
Could someone confirm and fixit in a new version?
I am using WP 4.9.7 and Buddypress 4.2.0.Tks
Douglas
- You must be logged in to reply to this topic.