Skip to:

Ajax directory search keeps breaking

  • peterverkooijen


    Ajax directory search keeps breaking whenever I change something in the template. In the latest case I made basically a copy of the entire site to another domain. Everything works, except members/groups/blogs search.

    I have a hard time troubleshooting it…

    How does the Ajax search work exactly?

    Which css ID does the jQuery need to show the results?

    Where is that jQuery script?

    What are the elements I need to have in place for the thing to work?

    Which database tables does members search look in?

    My problem may be similar to problems mentioned here, but I didn’t want to hijack that thread.

    I know about replacing $ with jQuery to prevent clashes. Don’t think that’s the issue here.

Viewing 6 replies - 1 through 6 (of 6 total)

  • peterverkooijen


    Found the culprit. I had replaced this in the members-loop.php:

    <?php if ( bp_has_site_members( 'type=active&per_page=10' ) ) : ?>

    with this:

    <?php if ( bp_has_site_members( 'type=random&per_page=10' ) ) : ?>

    But WHY does that break the Ajax search?!

    Or is ‘random’ not an accepted type? It did give the required result…



    It also works fine with:

    <?php if ( bp_has_site_members( 'type=newest&per_page=10' ) ) : ?>

    But not with ‘random’.


    BTW, I apparently also lost pagination on the members directory somewhere along the way. Any ideas what could break that?

    random is a supported argument for that function, yes.

    Oh, long shot – try replacing & with &

    & amp ;

    (without the spaces)



    No effect.

    I’ll just leave it on ‘newest’ for now. I think all that Ajax stuff needs a serious second look. It all breaks very easily. I also lost pagination somewhere along the way and I noticed you can’t just stick the members search tag in the profile page, for example.

    With Ajax the PHP, javascript and CSS are all intertwined. If I had a clearer picture how these pieces work they’d be easier to deal with, but I can’t even find the javascript for that search box. Probably hidden deep inside core files somewhere.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Ajax directory search keeps breaking’ is closed to new replies.
Skip to toolbar