Skip to:
Content

BuddyPress.org

Ticket #8037: 8037.diff

File 8037.diff, 771 bytes (added by boonebgorges, 7 years ago)
  • src/bp-groups/classes/class-bp-groups-group.php

    diff --git src/bp-groups/classes/class-bp-groups-group.php src/bp-groups/classes/class-bp-groups-group.php
    index 5f79e6fb9..5c40c011b 100644
    class BP_Groups_Group { 
    12021202                }
    12031203
    12041204                if ( ! is_null( $r['parent_id'] ) ) {
    1205                         // Note that `wp_parse_id_list()` converts `false` to 0.
    1206                         $parent_id        = implode( ',', wp_parse_id_list( $r['parent_id'] ) );
     1205                        // For legacy reasons, `false` means groups with no parent.
     1206                        if ( false === $r['parent_id'] ) {
     1207                                $parent_id = 0;
     1208                        } else {
     1209                                $parent_id = implode( ',', wp_parse_id_list( $r['parent_id'] ) );
     1210                        }
     1211
    12071212                        $where_conditions['parent_id'] = "g.parent_id IN ({$parent_id})";
    12081213                }
    12091214