Skip to:
Content
Pages
Categories
Search
Top
Bottom

Pagination on Members broken after update


  • adamt19
    Participant

    @adamt19

    After upgrading from 2.0.2 to 2.1.1, which is supposed to include a fix for the pagination links when search parameters are applied, I’ve noticed that I can’t get past page 2 in a list of results.

    i.e. ?upage=2 is rendered into the ‘next’ link even when on page 2

    To make matters worse, reverting back to the old BuddyPress folder didn’t fix it!

    I have ‘no-ajax’ applied on the pagination, because of a long standing issue with ajax-driven members pages, where performing a search, going to page 2, viewing a profile, then going ‘back’ to results, and requesting page 3…….loses all of the search params.

    So I’m stuck between a rock and a hard place here. no-ajax pagination was tolerable until it broke. Any ideas?

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

  • adamt19
    Participant

    @adamt19

    @r-a-y I noticed you worked on a similar issue for when ajax is enabled in the messaging views.

    I can provide guest account credentials if you’d be willing to help out here — live site issue at the moment D:


    adamt19
    Participant

    @adamt19

    Adding this code above $this->$pag_links to bp-members-template solved the issue for us..

    /**
    			 * Defaults to an empty array to make sure paginate_links()
    			 * won't add the $page_arg to the links which would break
    			 * pagination in case javascript is disabled.
    			 */
    			$add_args = array();
    
    			if ( ! empty( $search_terms ) ) {
    				$add_args['s'] = urlencode( $search_terms );
    			}
    
    			$this->pag_links = paginate_links( array(
    				'base'      => add_query_arg( $pag_args, $base ),
    				'format'    => '',
    				'total'     => ceil( (int) $this->total_member_count / (int) $this->pag_num ),
    				'current'   => (int) $this->pag_page,
    				'prev_text' => _x( '←', 'Member pagination previous text', 'buddypress' ),
    				'next_text' => _x( '→', 'Member pagination next text', 'buddypress' ),
    				'mid_size'  => 1,
    				'add_args'  => $add_args,
    			) );

    Magic-Komplex
    Participant

    @magic-komplex

    Had the same problem, it was a theme-incompatibility problem on my website, changing the theme helped. Don’t know if this helps, or if you still encounter this problem, but I thought I should tell you. 🙂


    evitorino
    Participant

    @evitorino

    @adamt19 this solution worked for me too.

    But editing BP plugin files seems a bit extreme, is there a way to change the function from within the theme files?

    Thankyou.


    r-a-y
    Keymaster

    @r-a-y

    This should be fixed in 2.2. What version of BuddyPress are you all using?


    evitorino
    Participant

    @evitorino

    2.1.1

    Problem is that i’m using other modules and themes, and i must still setup a BP 2.2 development site version.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Pagination on Members broken after update’ is closed to new replies.
Skip to toolbar