Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

WP search results page kills BP member widgets (9 posts)

Started 9 months ago by: pcwriter

  • Profile picture of pcwriter pcwriter said 9 months ago:

    Hi all!

    I just noticed that when using the WP searchform, member widgets on the results page display
    “No one has signed up yet!” (Members widget)
    “There are no users currently online” (Who’s Online widget)
    “There are no recently active members” (Recently Active widget)

    Has anyone else encountered this oddity and, if so, care to share a solution if you have one? :-)

  • Profile picture of Nahum Nahum said 9 months ago:

    this sounds familiar…i think i posted about this a while back somewhere(i’ll look), that the bp loops clashed with the search results page. it’s still the case too, I’ve had to not put any bp widgets on search results page sidebars.

  • Profile picture of Nahum Nahum said 9 months ago:

    here it is…http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/search-php-template-vs-custom-bp-loops/ (no responses) :)

    and i’m wondering if this is to do with it … http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/why-does-a-page-named-search-redirect-to-members-search/

  • Profile picture of pcwriter pcwriter said 9 months ago:

    @nuhammadrid

    Yeah, I had found both those posts during my search for a solution, but neither of them even hints at one :-(
    Brajesh Singh’s Global search results page does not create this conflict however. I think I’ll post over at BuddyDev to see if he has any bright ideas (he often does) and post back here if I get anywhere. Thanks!

  • Profile picture of pcwriter pcwriter said 9 months ago:

    @nuhammadrid

    Brajesh just posted a possible solution at BuddyDev:

    http://buddydev.com/forums/topic/wp-search-results-page-kills-bp-member-widgets#post-9892

    I’m going to try it tomorrow ‘cuz I’m off to bed right now, zzz……

  • Profile picture of pcwriter pcwriter said 9 months ago:

    @nuhammadrid and anyone else experiencing this odd behavior:

    Brajesh’s patch works just fine, but it requires a slight modification to bp-core-templatetags.php:

    Replace this (line 131):

    if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
    		$search_terms = $_REQUEST['s'];

    with this:

    if ( !is_search() && isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
    		$search_terms = $_REQUEST['s'];
  • Profile picture of pcwriter pcwriter said 9 months ago:

    Note that this patch is for BP1.2.9

  • Profile picture of leemour leemour said 7 months ago:

    I have the same bug in BP 1.5.1. To fix it I had to go to bp-members-template.php line 309 to replace the code with what @pcwriter posted. Should a ticket be made?

  • I’m very sorry, may be I did something wrong, could yoou help me? In this file (bp-members-template.php) I have line 309:

    // Pass a filter if ?s= is set.
    if ( is_null( $search_terms ) ) {
    if ( !empty( $_REQUEST['s'] ) )
    $search_terms = $_REQUEST['s'];
    else
    $search_terms = false;
    }

    Fnd when I tried to change I had an error, could you please tell me exactly what lines to change with what?