Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

#3406 closed defect (bug) (fixed)

Group Member ajax pagination broken

Reported by: johnjamesjacoby Owned by:
Milestone: 1.5.6 Priority: normal
Severity: normal Version:
Component: Groups Keywords: reporter-feedback
Cc: georgemamadashvili@…

Change History (15)

#1 @boonebgorges
9 years ago

  • Keywords dev-feedback 2nd-opinion added

Ajax pagination on these sorts of list is a mess. For this reason, I suggest that we turn off ajax on group members pagination lists. (Not sure how it got turned on, actually.)

Here's why it doesn't work. When you click a pagination link, our JS looks to see if you are on a highlighted nav tab, as a shortcut way of figuring out which kind of content it should load. In the case of group memberships, the id of the tab is "members-personal-li". The JS then splits this id in order to get the params for the AJAX request https://buddypress.trac.wordpress.org/browser/trunk/bp-themes/bp-default/_inc/global.js#L566; the first part of the split, "members", is then used to determine a template file that should be loaded to get the ajax response value https://buddypress.trac.wordpress.org/browser/trunk/bp-themes/bp-default/_inc/ajax.php#L84. The problem is that members/members-loop.php does a bp_has_members() query, not bp_group_has_members(), and as a result an invalid response is returned.

To work our way around this, we'd need to either rewrite the entire way that pagination ajax works, or create a special case for groups members pages, or at the very least split the loop portion of groups/single/members.php into its own file, so that it could be requested on the ajax request (which would take some finagling, but would be possible). IMO, all three options are far too much work.

So, once again, I opt that we add the 'no-ajax' class to the pagination block for this version of BP. We can consider refactoring the pagination ajax to be less convoluted sometime in the future.

#2 @DJPaul
9 years ago

Did ajax pagination work in the 1.2 dtheme?

#3 @boonebgorges
9 years ago

No. It's marked no-ajax in the 1.2 branch, probably for this very reason. I recommend we restore the no-ajax class.

#4 @DJPaul
9 years ago

Go for it

#5 @boonebgorges
9 years ago

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

(In [4900]) Disable ajax pagination on group members page. Fixes #3406

#6 @shaunmacrae
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Guys,

I think this symptom exists in a number of other places. In fact, this was fixed for the top navigation for group members but not for the bottom navigation on the same group members page. As a result top navigation in the bp-default theme is working but bottom navigation is not.

Also this fix needs to be applied to the member listing page. At the moment all pagination is broken for member listings in bp-default theme. I applied the 'no ajax' logic to top and bottom navigation there and all is working for me.

Shaun

#7 @boonebgorges
9 years ago

  • Keywords reporter-feedback added; needs-patch dev-feedback 2nd-opinion removed

shaunmacrae - What theme are you using? What version of BP?

#8 @shaunmacrae
9 years ago

BP 1.5.4
BP-Default theme

Thanks for investigating.

#9 @boonebgorges
9 years ago

(In [5894]) Disable ajax for bottom pagination links on groups members pages. See #3406. Props shaunmacrae

#10 @boonebgorges
9 years ago

  • Milestone changed from 1.5 to 1.5.5

I confirmed that this was a problem for the group members page. But AJAX pagination appears to be working elsewhere in the theme, including the main members directory. shaunmacrae, if it's not working for you, can you provide more details on exactly what's happening? It would be especially helpful if you could share the contents of the javascript console during a failed AJAX request.

#11 @Mamaduka
9 years ago

  • Cc georgemamadashvili@… added

#12 @DJPaul
9 years ago

  • Milestone changed from 1.5.5 to 1.5.6

#13 @shaunmacrae
9 years ago

Gents, thanks for the fix. Working well now. Also confirmed that the member paging was not working due to a conflict with another plugin called BP Member Filter. When I disable that plugin, all is well.

#14 @DJPaul
9 years ago

Is this ticket resolved now? Can it be closed?

#15 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.