• Hello Team,

    I’m writing to report an oversight in Paid Memberships Pro – BuddyPress Add On version 1.1.1.

    Right after line 34 of includes/directory.php:

    $query_array->query_vars['include'] = array_intersect( $query_array->query_vars['include'], $pmpro_bp_members_in_directory );

    this code should be inserted:

    if (count ($query_array->query_vars['include']) == 0) $query_array->query_vars['include'] = array (0);

    Otherwise, when the intersection is empty, the directory will show all the users instead of ‘no results found’.

    Thank you for looking into this!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You are the BOMB!!! Thank you Andrea!! (That’s my name too ?? )

    For me it was line 74 under // Only include members in the directory.

    Replace

    $query_array->query_vars[‘include’] = $pmpro_bp_members_in_directory;

    with

    if (count ($query_array->query_vars[‘include’]) == 0) $query_array->query_vars[‘include’] = array (0);

    @commandrea That worked for me too! Thanks you all!

    Version 1.2.3 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;
    	}
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Suggesting a patch’ is closed to new replies.