[buddypress-trac] [BuddyPress Trac] #7704: [legacy template pack]: Ajax pagination and filters for group members list shows all members

buddypress-trac noreply at wordpress.org
Mon Feb 26 20:27:21 UTC 2018


#7704: [legacy template pack]: Ajax pagination and filters for group members list
shows all members
--------------------------+-----------------------------
 Reporter:  jdgrimes      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Templates     |    Version:  2.9.3
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 == Steps to reproduce:

 - First be sure that you are using the Legacy template pack, and that JS
 is enabled in your browser.
 - Go to the Members tab for a group. Note the number of members and number
 of pages.
 - Then either click on page 2 (or another page), or change the selection
 in the order by dropdown.

 == Expected result:

 The next page is displayed or the members list is reordered, respectively.

 == Actual result:

 The Ajax refresh will result in all members being included in the list,
 not just the members of the group.

 Tested on both 2.9.3 and trunk.

 == The cause:

 The problem appears to be that `bp_legacy_theme_object_template_loader()`
 contains this:

 {{{#!php
 <?php

         if ( ! empty( $_POST['template'] ) && 'groups/single/members' ===
 $_POST['template'] && 'members' === $object ) {
                 $template_part = 'groups/single/members.php';
         }

 }}}


 However, in `buddypress.js`, in `bp_filter_request()`, is this:

 {{{#!php
 <?php

         if ( 'friends' === object || 'group_members' === object ) {
                 object = 'members';
         }

 }}}


 So the value of `object` ends up being `members` instead of
 `group_members`, in the Ajax request. But it is expected to be
 `group_members` in the Ajax response handler, for the correct template to
 be used.

 == The fix:

 Changing `group_members` to `members` in
 `bp_legacy_theme_object_template_loader()` fixed the issue for me.

 #goodfirstbug

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7704>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list