Opened 13 years ago
Closed 13 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@… |
Description
Change History (15)
#3
@
13 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.
#6
@
13 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
@
13 years ago
- Keywords reporter-feedback added; needs-patch dev-feedback 2nd-opinion removed
shaunmacrae - What theme are you using? What version of BP?
#10
@
13 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.
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.