Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#6745 closed defect (bug) (fixed)

AJAX pagination doesn't account for new component search parameter

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 2.4.2 Priority: normal
Severity: normal Version: 2.4.0
Component: Core Keywords: has-patch
Cc:

Description (last modified by r-a-y)

Reported here:
https://buddypress.org/support/topic/bp-2-4-breaks-on-page-2-of-custom-search-results/#post-247021

When we changed the search parameter for BuddyPress directory pages (#5087), we did not account for pagination.

Attached patch fixes this.

Note: We currently do not add the search term parameter for pagination in the activity or blog template loops. We probably should do this either in 2.4.1 or 2.5.0.


This bug also uncovered an error with how we parse pagination page numbers in AJAX since WordPress 4.1. See #WP30831. The problem is due to r7946. (Basically, what henry.wright warned me about here - ticket:5404#comment:13! Boo Ray!)

The page number fix reverts what I committed in #5404 with what I originally recommended here:
https://buddypress.trac.wordpress.org/attachment/ticket/5404/5404.01.2.patch

I would preferably like to include this fix in 2.4.1 as well.

Attachments (1)

6745.01.patch (2.5 KB) - added by r-a-y 8 years ago.

Download all attachments as: .zip

Change History (12)

@r-a-y
8 years ago

#1 @r-a-y
8 years ago

  • Description modified (diff)

#2 @boonebgorges
8 years ago

Changes look good to me . Mea culpa for not thinking of this in #5087.

#3 @r-a-y
8 years ago

#6189 was marked as a duplicate.

Going to commit this now!

#4 @r-a-y
8 years ago

In 10378:

Make sure search terms are passed when rendering pagination.

r10110 altered the search query parameter for each BuddyPress component
(see #5087). However, we also need to change the search query parameter in
our template loops so pagination will work when a search is in effect.

This commit alters the Members and Groups component template loops to use
the new search query parameter and alters the JS to find the correct search
term value.

See #6745 (trunk).

#5 @r-a-y
8 years ago

In 10379:

JS: Fix an issue with parsing the page number when clicking on a pagination link.

Previously, when a paginated link is clicked, we grabbed the page number
from the URL. This isn't great as the URL is unreliable to parse the page
number (see #6189).

This commit partially reverts r7946 to use the older page number parsing,
but with some logic to properly parse numbers.

See #6745 (trunk).

Anti-props r-a-y.

#6 @r-a-y
8 years ago

In 10380:

Make sure search terms are passed when rendering pagination.

r10110 altered the search query parameter for each BuddyPress component
(see #5087). However, we also need to change the search query parameter in
our template loops so pagination will work when a search is in effect.

This commit alters the Members and Groups component template loops to use
the new search query parameter and alters the JS to find the correct search
term value.

See #6745 (2.4-branch).

#7 @r-a-y
8 years ago

In 10381:

JS: Fix an issue with parsing the page number when clicking on a pagination link.

Previously, when a paginated link is clicked, we grabbed the page number
from the URL. This isn't great as the URL is unreliable to parse the page
number (see #6189).

This commit partially reverts r7946 to use the older page number parsing,
but with some logic to properly parse numbers.

See #6745 (2.4-branch).

Anti-props r-a-y.

#8 @r-a-y
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#9 @r-a-y
8 years ago

In 10382:

Tests: Update members search pagination test.

Forgot to update the search parameter in the test!

See #6745.

Anti-props r-a-y.

#10 @djpaul
8 years ago

In 10390:

Tests: Update members search pagination test. (2.4 branch)

See #6745.

#11 @DJPaul
8 years ago

  • Component changed from Component - Any/All to Core
Note: See TracTickets for help on using tickets.