This topic has 28 replies, 4 voices, and was last updated 9 years by Adam.

  • Author
  • #22318
     Adam
    Participant

    If you perform a search from /Members, view a profile, use the back button to return to /Members, the last set of results is still displaying, but clicking on page 2, 3 etc. shows members outside of the originally selected filters.

    e.g.
    * visit meetmindful.com/members
    * click ‘Search’
    * choose sex: ‘Female’; age ’20’ to: ’30’;
    * submit Search
    * Click on someone’s profile
    * Use the ‘back’ button to return to the Members page
    * Observe search parameters still in addressbar (good)
    * Observe “Your search returned *** results” (good)
    * Click page 2
    * Observe members outside of age range displaying, for example

    I know the pagination uses AJAX. It seems to be ignoring the parameters selected in the search form / in the address bar?

    #22319
     Adam
    Participant

    Note: simply running a search and clicking page 2, 3, etc works fine. This problem only occurs if you leave the members page and use ‘back’ button to return.

    #22420
     Abe
    Keymaster

    Well yes since the pagination is done by AJAX that back button will return you to the members page on page 1

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #22421
     Adam
    Participant

    @abe yes that is expected. The back button returns me to page 1. But after that, if I click on page 2, page 2 should show members according to the filters. It even says “Your search found xxx”, etc.

    In other words, it we need to check for search-form selections/filters every time page 2, 3 etc is clicked.

    #22533
     Abe
    Keymaster

    I see what you mean.. we will see why this happens.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #23247
     Adam
    Participant

    Hi @abe – We’re implementing a radius-based postal-code filter on our /members page, and having some trouble with the AJAX results on pages 2, 3, etc, as well.

    While we’re working on this problem we may arrive at a solution for the first issue mentioned here. And if so, we’ll pass it along.

    #23665
     Adam
    Participant

    adding ‘no-ajax’ to the pagination div to disable AJAX seems the best course of action for now.

    We would like to re-enable it when possible!

    #26435
     Adam
    Participant

    @abe any progress on this? I’d love to be able to re-enable ajax on the members page.

    We re-designed the discovery process a bit,
    http://www.meetmindful.com/members/ (I believe you have a free account already..)

    I noticed when adding no-ajax to disable ajax browsing, the ‘Favorites’ tab pagination breaks.

    (Favorites is my modified version of the followers plugin.)

    THe pagination still points to a /wp-admin/ajax.php address, and the page errors out with a simple ‘0’. I imagine this is because the ajax URL is wp-admin/admin-ajax.php.

    Anyway, this means I have to disable the ‘Favorites’ tab entirely until this is worked out, or switch to enabling ajax on the members page and dealing with the other bug that loses search parameters after viewing a profile and hitting ‘back’ (topic of thread.)

    Thoughts?

    #26563
     Adam
    Participant

    I found that ‘no-ajax’ needs to be applied to the .item-list.search list div in the members loop as well.

    When this is done, clicking on the tab to switch to ‘friends’ (or in my case ‘following’ or ‘favorites’) will point to the user’s profile, with their friends/followers/favorites loaded, depending on whatever /path/ you have assigned for this filter/loop.

    So this allows me to show my users’ favorites again, but we’d still love if we can actually use AJAX, which is being prevented by the bug that does not retain search filters after visiting a profile and hitting ‘back’.

    Perhaps we could solve this by saving all search params in cookies and checking for the values of those cookies every time a pagination link is clicked, when AJAX browsing is enabled??

    #26877
     Abe
    Keymaster

    I will do some research next week on this and hopefully come with a solution.
    I really like how your site evolved. I look very good. Congrats.
    We will build a small showcase section on Sweetdate Themeforest page. Can we include also your site there?

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #26879
     Adam
    Participant

    Thanks!

    Yes, you can include our site there.

    I would be happy to test any patches for you, if needed. We have about 1,500 users.

    #26880
     Abe
    Keymaster

    Great, I wish you many many users 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #30479
     Adam
    Participant

    hi @Abe,

    Is there no hope on enabling AJAX for member’s browsing? 🙁

    meetmindful.com/members

    the two bugs:
    1) viewing a profile, returning to /members, and paging->forward after a search loses the search parameters.

    2) without a search (simply visiting /members) you can only page-forward 1 or 2 times. On page the extra ‘0’ on the end of the response breaks the page. (Happens with AJAX-driven friends lists too)

    #31067
     Abe
    Keymaster

    hi @Adam
    I got an idea an I am working on this today. Will keep you posted 😉

    PS. What have you used for the zip code nearby search?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #31068
     Abe
    Keymaster

    Your other problem must come from something on your side since I can’t reproduce it on the demo

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #31097
     Abe
    Keymaster

    in /wp-content/themes/sweetdate/custom_buddypress/_inc/global.js around line 714 add after:

    COPY CODE
    
    			jq('html, body').animate({
    				scrollTop: jq(".item-list-tabs").offset().top
    			}, 500);
    
    

    this:

    COPY CODE
    
                if (object == 'members') {
                    window.history.pushState(null, null, jq(target).attr('href'));
                }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #31143
     Adam
    Participant

    Hi Abe,

    This works better but I think there’s another piece that needs a fix.

    With the update you provided, I can perform a search, move to page 2, view a profile, click the back-button, and then move to page 3, and the results still match my query.

    However, after page 2 the pagination links change to /admin-ajax.php?page=X.

    So if I view another profile and then use the back-button to return to this page, I the blank-page and ‘0’ response.

    It seems if we can maintain the proper URL on the pagination links at all times, this issue will be fully resolved! Any ideas?

    #31144
     Adam
    Participant
    This reply has been set as private.
    #31194
     Abe
    Keymaster

    It might something on your end since on the demo site it does not happen. try to update buddypress or the theme.
    seventhqueen.com/demo/sweetdatewp/members

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #31204
     Adam
    Participant

    It probably is – I’ll keep looking!

    However, on your demo site, the URL doesn’t update with any upage information. So when I view a member on page 3, and then go “Back”, it goes back to the beginning?

    #31210
     Abe
    Keymaster

    I haven’t implemented it yet on the demo

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #35969
     adam
    Participant

    hi @adam – you’re an awesome developer/designer. any interest in helping me with my site http://www.couplefriends.com? even if you have just a little time to spare it would be appreciated. i can pay. you can email me at emailadamrose at gmail.com thanks! -adam

    #42826
     Adam
    Participant

    @abe I’m still working on this issue.

    Should bp_filter_request use the bp-members-search cookie (contains query string) when using AJAX on the members search?

    I found:
    bp-members-search is set when executing search. It contains search params/query string.
    When viewing a user profile, bp-members-search is deleted (???)
    When going back to search results, with bp-members-search gone, the next page of results *loses* the query information.

    Desperate for help here!

    I’m going to duplicate the cookie information into my own cookie, then re-set it into bp-members-search when viewing profiles. But my query string also has new information (“zipradius” for example,) and Im trying to figure out how to use bp_filter_request to include my custom params.

    #43165
     Abe
    Keymaster

    @meetmindful have you tried to update to latest theme version available? the back button should go back to the page and the GET parameters in the link should be preserved. On our demo it behaves right.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #43242
     rweiss
    Participant

    I’m wondering if this issue is due to child-theme function.php adaptations?

    For example, although this is a different issue, do we still need this in the child theme functions?

    /* Birthday to age in profile page */
    bp_get_the_profile_field_value();
    add_filter(‘bp_get_the_profile_field_value’, ‘kleo_age_field’,10,3);
    function kleo_age_field($value, $type, $id) {
    $age_field = sq_option(‘bp_age_field’);
    if ($age_field == $id) {
    $value = xprofile_get_field_data($id);
    $diff = time() – strtotime($value);
    $age = floor($diff / (365*60*60*24));
    $value = sprintf( _n( ‘%s year’, ‘%s years’, $age, ‘buddypress’ ), $age );
    }
    return $value;
    }

    I’m uploading my child-theme functions.php so you can see it. I’m just wondering if the cause of what Adam is seeing (which I am also dealing with) is caused by old adaptations done in that file.

    #43244
     rweiss
    Participant

    I guess i can’t upload php files. I saved it as a text file

    Attachments:
    You must be logged in to view attached files.
    #43306
     Adam
    Participant

    @abe I’ve updated to 2.8 and the field_x parameters work after using BACK.

    However, I have a another field (‘zipradius’; radius from provided ZIP code) and the &zipradius=x value is ignored. Could you help me trace how the ajax ‘next’ or ‘2,3,4’) links work?

    Do they get parameters from a cookie, or directly from GET? I can’t pin down the code that actually requests page 2,3,4 and passes the search parameters.

    #43646
     Abe
    Keymaster

    the links are generated by BuddyPress and they should take what is in the GET parameters

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #43716
     Adam
    Participant

    I’m noticing the only way this works is if I stay on BP 2.0.1 and put ‘no-ajax’ on all of the ‘pagination’ divs.

    Upgrade to BP2.1.1 = perform search and page ‘2’ does not use GET parameter ‘zipradius’

    With either 2.0.1 or BP2.1.1, removing ‘no-ajax’ from ‘pagination’ DIV = URLs change to /admin-ajax.php?upage=2 or 3

Viewing 29 posts - 1 through 29 (of 29 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?