Skip to:
Content
Pages
Categories
Search
Top
Bottom

Error searching member in group


  • douglasndv
    Participant

    @douglasndv

    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

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    Please use the code button when posting code.

    I cannot duplicate your issue using WP 5.0.3 and BP 4.2.0

    Have you tried switching themes and deactivating other plugins to see if that clears the error ?

    Afaik – auto-suggestions are not used by default in a group > members > search
    Do you have some custom code that is calling wp_ajax_bp_get_suggestions ?

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar