Skip to:

Pagination in Group Tree not working

  • My site is I’m running the latest WP 3.2.1 along with BP 1.2.9 and BP Group Hierarchy 1.1.7. Our site has grown and under our “University” group, we now have 21 University Sub-groups. When I view the universities on the group tree, the fact that we now have 21 sub-group forces us into a pagination situation but when I click on page 2, nothing happens.

    Is it possible to turn off pagination on the Group Tree as a workaround? I think that by the end of the year we will have about 60 Universities in the network and thus 60 subgroups.


Viewing 4 replies - 1 through 4 (of 4 total)
  • For a quick workaround, put the code below as line 577 in extension.php. Bump down the current line 577 to 578.

    ` if($parent_id != 0) $params = array_merge( $params, array(‘per_page’=>100));`

    I think you’ll still see the pagination links, but it’ll show all the child groups.

    Thanks for the response but when I look at the code in my Komodo editor, line 577 does not make sense as it is just a blank line. Can you give me the old 577 line as a reference and the function that it should be in?



    Never mind, I think that I found it (anyway I can get this to work) What I did was to put the line into:

    function bp_group_hierarchy_has_groups_tree($groups, $params, $parent_id = 0) {
    global $bp, $groups_template;

    if($_POST == ‘tree’ && $_POST != ‘all’) {
    $parent_id = substr($_POST,8);
    $parent_id = (int)$parent_id;

    if(!isset($bp->groups->current_group->id) && !$params) {

    $params = array_merge( $params, array(‘parent_id’ => $parent_id) );
    if($parent_id != 0) $params = array_merge( $params, array(‘per_page’=>100));
    $toplevel_groups = bp_group_hierarchy_get_by_hierarchy( $params );
    $groups = $toplevel_groups;


    return $groups;

    It now displays all 21 sub-groups (and I suspect that this will work to 100) but it still displays the pagination that there are only 20 groups being displayed.

    Thanks, for the fix, this gets us functional for awhile.


    That’s exactly where it was supposed to go. :) I apologize if that line number didn’t match up – I’ve been working off a 1.3-compatible branch and it didn’t occur to me that it didn’t match the current mainline release version.

    I hope to have a more satisfactory solution out sometime next week.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pagination in Group Tree not working’ is closed to new replies.
Skip to toolbar