• Resolved kalizi

    (@kalizi)


    Hi there, thank you for this plugin, saved me a lot of time.
    I installed it with “BuddyPress Xprofile Custom Field Types”, and set up a form in order to search by using two custom fields: the first one is a select (is one of), the second one is an input field (contains). The form is set with POST method, and the template is “members/bps-form-sample-2”.

    The search correctly works, but if no member is found, the plugin doesn’t show an error, or a message, instead it shows all members, like no filter is applied.
    Can this be solved or is my configuration wrong?

    Thanks in advance!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi kalizi,

    That could be a plugin or theme conflict. Could you try to switch to a default theme? If that doesn’t work, you could deactivate all your plugins except BuddyPress and BP Profile Search and see if the problem goes away.

    You could also post the site health info you find in:

    Tools -> Site Health -> Info -> Copy site info to clipboard

    Use my Contact page if you don’t want to share it publicly.

    Thread Starter kalizi

    (@kalizi)

    I’m currently using this theme: Aardvark (https://themeforest.net/item/aardvark-buddypress-membership-community-theme/21281062) with his related plugin.
    The theme includes as profile search theme “members/bps-form-sample-2”, that your plugin shows as outdated.

    I tried to “debug” the theme and for this management the folder structure is like:
    | – buddypress\
    | — bps-form-sample-2.php
    | — members-loop.php
    | — single\
    | — home.php
    | — member-header.php

    I looked at members-loop.php, and at loop start there is:
    <?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
    that always return true, even if no users found.

    I have no problems copying site health info:

    
    ### wp-core ###
    
    version: 5.2.1
    site_language: it_IT
    user_language: it_IT
    permalink: /%category%/%postname%/
    https_status: true
    user_registration: 1
    default_comment_status: open
    multisite: false
    user_count: 3
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /home/mgzrgcbf/public_html
    wordpress_size: loading...
    uploads_path: /home/mgzrgcbf/public_html/wp-content/uploads
    uploads_size: loading...
    themes_path: /home/mgzrgcbf/public_html/wp-content/themes
    themes_size: loading...
    plugins_path: /home/mgzrgcbf/public_html/wp-content/plugins
    plugins_size: loading...
    database_size: loading...
    total_size: loading...
    
    ### wp-dropins (1) ###
    
    db.php: true
    
    ### wp-active-theme ###
    
    name: Aardvark Child
    version: 1.0
    author: GhostPool
    author_website: https://www.ghostpool.com
    parent_theme: Aardvark
    theme_features: custom-background, wp-block-styles, align-wide, editor-styles, editor-style, automatic-feed-links, post-formats, title-tag, customize-selective-refresh-widgets, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, sensei, buddypress-use-legacy, menus, post-thumbnails, widgets
    theme_path: /home/mgzrgcbf/public_html/wp-content/themes/aardvark
    
    ### wp-themes (4) ###
    
    Aardvark: version: 3.6, author: GhostPool
    Twenty Nineteen: version: 1.4, author: Team di WordPress
    Twenty Seventeen: version: 2.2, author: il team di WordPress
    Twenty Sixteen: version: 2.0, author: il team di WordPress
    
    ### wp-mu-plugins (1) ###
    
    akeeba-backup-coreupdate.php: author: (undefined), version: (undefined)
    
    ### wp-plugins-active (24) ###
    
    Aardvark Plugin: version: 2.2.3, author: GhostPool
    Advanced Ads: version: 1.13.6, author: Thomas Maier
    Akeeba Backup for WordPress: version: 3.5.1, author: Akeeba Ltd
    bbPress: version: 2.5.14, author: The bbPress Community
    BP Profile Search: version: 5.0.5, author: Andrea Tarantini
    BuddyPress: version: 4.3.0, author: The BuddyPress Community
    BuddyPress Xprofile Custom Field Types: version: 1.0.7, author: BuddyDev
    Classic Editor: version: 1.5, author: WordPress Contributors
    Contact Form 7: version: 5.1.3, author: Takayuki Miyoshi
    Events Manager: version: 5.9.5, author: Marcus Sykes
    iubenda Cookie Solution for GDPR: version: 1.15.8, author: iubenda
    Limit Login Attempts Reloaded: version: 2.8.1, author: WPChef
    Official Facebook Pixel: version: 1.7.25, author: Facebook
    Paid Memberships Pro: version: 2.0.5, author: Stranger Studios
    Paid Memberships Pro - BuddyPress Add On: version: 1.2.3, author: Paid Memberships Pro
    Paid Memberships Pro - MailChimp Add On: version: 2.1.1, author: Stranger Studios
    Query Monitor: version: 3.3.6, author: John Blackbourn
    Responsive for WPBakery Page Builder: version: 3.1, author: BestBug
    rtMedia for WordPress, BuddyPress and bbPress: version: 4.5.6, author: rtCamp
    Theia Sticky Sidebar: version: 1.8.0, author: WeCodePixels
    Ultimate Reviewer: version: 1.3.2, author: GhostPool
    WordPress Popular Posts: version: 4.2.2, author: Hector Cabrera
    WPBakery Page Builder: version: 5.7, author: Michael M - WPBakery.com (latest version: 6.0.2)
    Yoast SEO: version: 11.3, author: Team Yoast
    
    ### wp-plugins-inactive (3) ###
    
    LayerSlider WP: version: 6.8.2, author: Kreatura Media
    WooCommerce: version: 3.6.4, author: Automattic
    WP Live Chat Support: version: 8.0.32, author: WP-LiveChat
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_Imagick
    imagick_module_version: 1656
    imagemagick_version: ImageMagick 6.7.8-9 2019-01-30 Q16 https://www.imagemagick.org
    imagick_limits: 
    	imagick::RESOURCETYPE_AREA: 125 GB
    	imagick::RESOURCETYPE_DISK: -1
    	imagick::RESOURCETYPE_FILE: 768000
    	imagick::RESOURCETYPE_MAP: 125 GB
    	imagick::RESOURCETYPE_MEMORY: 63 GB
    	imagick::RESOURCETYPE_THREAD: not available
    gd_version: bundled (2.1.0 compatible)
    ghostscript_version: 9.07
    
    ### wp-server ###
    
    server_architecture: Linux 3.10.0-962.3.2.lve1.5.24.10.el7.x86_64 x86_64
    httpd_software: Apache
    php_version: 7.1.28 64bit
    php_sapi: litespeed
    max_input_variables: 100000
    time_limit: 300
    memory_limit: 512M
    max_input_time: 600
    upload_max_size: 256M
    php_post_max_size: 256M
    curl_version: 7.64.0 OpenSSL/1.0.2r
    suhosin: false
    imagick_availability: true
    htaccess_extra_rules: false
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 5.5.5-10.1.38-MariaDB-cll-lve
    client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/mgzrgcbf/public_html/wp-content
    WP_PLUGIN_DIR: /home/mgzrgcbf/public_html/wp-content/plugins
    WP_MAX_MEMORY_LIMIT: 512M
    WP_DEBUG: true
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_LOCAL_DEV: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    mu-plugins: writable
    
    
    • This reply was modified 5 years, 6 months ago by kalizi.
    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi kalizi,

    Please try deactivating Paid Memberships Pro – BuddyPress Add On. It’s known to conflict with BP Profile Search, see:

    https://www.ads-software.com/support/topic/suggesting-a-patch/

    Unfortunately the bug is still there in Paid Memberships Pro – BuddyPress Add On version 1.2.3.

    Thread Starter kalizi

    (@kalizi)

    I tried with your patch, so the code became:

    if( is_array( $query_array->query_vars['include'] ) ) {
    	// Compute the intersect of members and include value.
    	$query_array->query_vars['include'] = array_intersect( $query_array->query_vars['include'], $pmpro_bp_members_in_directory );
    
    	// PATCH START
    	if (count ($query_array->query_vars['include']) == 0)
    		$query_array->query_vars['include'] = array (0);
    	// PATCH END
    
    } else {
    	// Only include members in the directory.
    	$query_array->query_vars['include'] = $pmpro_bp_members_in_directory;
    }
    

    But doesn’t help, so, before the if statement I put:
    var_dump($query_array->query_vars['include']); die();
    And all I got is a
    string(1) "0"

    Am I doing something wrongly or putting the code in the wrong line?

    • This reply was modified 5 years, 6 months ago by kalizi.
    Thread Starter kalizi

    (@kalizi)

    Fixed this way:

    if( is_array( $query_array->query_vars['include'] ) ) {
    	// Compute the intersect of members and include value.
    	$query_array->query_vars['include'] = array_intersect( $query_array->query_vars['include'], $pmpro_bp_members_in_directory );
    	if (count ($query_array->query_vars['include']) == 0)
    		$query_array->query_vars['include'] = array (0);
    } else {
    	if (is_string($query_array->query_vars['include']) && $query_array->query_vars['include'] == "0")
    		$query_array->query_vars['include'] = array (0);
    	else {
    		// Only include members in the directory.
    		$query_array->query_vars['include'] = $pmpro_bp_members_in_directory;
    	}
    }
    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi kalizi,

    Thank you for sharing the solution, apparently my patch only solves one half of the problem!

    Hi there. I’ve been monitoring this as I had the same issue. Could you kindly verify this fix replaced line 74 in Paid Membership Pro, or BP Xprofile. I’m sure answer is right there, I just want verification.

    Thread Starter kalizi

    (@kalizi)

    @pcmaxx I have 1.2.3 of pmpro-buddypress as installed version and had to change line 40 with the solution provided before and added my solution at line 43. Final code is (as before):

    if( is_array( $query_array->query_vars['include'] ) ) {
    	// Compute the intersect of members and include value.
    	$query_array->query_vars['include'] = array_intersect( $query_array->query_vars['include'], $pmpro_bp_members_in_directory );
    	if (count ($query_array->query_vars['include']) == 0)
    		$query_array->query_vars['include'] = array (0);
    } else {
    	if (is_string($query_array->query_vars['include']) && $query_array->query_vars['include'] == "0")
    		$query_array->query_vars['include'] = array (0);
    	else {
    		// Only include members in the directory.
    		$query_array->query_vars['include'] = $pmpro_bp_members_in_directory;
    	}
    }

    The if started at line 37 in my directory.php file.

    • This reply was modified 5 years, 6 months ago by kalizi.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Search shows all members if no profiles found’ is closed to new replies.