Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#5746 closed enhancement (fixed)

using bp_group_has_members in widgets and conflicts with $_REQUEST['s']

Reported by: WCUADD Owned by: boonebgorges
Milestone: 2.1 Priority: normal
Severity: normal Version:
Component: Groups Keywords: has-patch
Cc:

Description

Same problem reported in #5318 and fixed with null initialization of $default_args['search_terms'] and is_null() test before assigning $_REQUEST['s'].

This permits to run a secondary members loop in a page (for instance in a widget) while primary loop is whatever loop (buddypress ou wordpress loop) using the search s argument.

While the problem has been solved for the bp_has_members() loop, it has not been solved for bp_group_has_members() loop causing false results (even with fixing search_terms to false in the args array given to the loop).

Attachments (1)

5746.patch (909 bytes) - added by WCUADD 5 years ago.

Download all attachments as: .zip

Change History (4)

@WCUADD
5 years ago

#1 @WCUADD
5 years ago

  • Keywords has-patch added

#2 @boonebgorges
5 years ago

  • Milestone changed from Awaiting Review to 2.1
  • Type changed from defect (bug) to enhancement

This looks good. Thanks.

(One small request - in the future, please generate your patch from the root of the buddypress directory. Thanks!)

#3 @boonebgorges
5 years ago

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

In 8574:

Only get 'search_terms' out of $_REQUESTs? in bp_group_has_members() if no 'search_terms' param has been passed to the function

This allows secondary, search-free loops to be run on a page, by passing an
empty string to the 'search_terms' param. See #5318 for a similar strategy as
applied to members widgets.

Fixes #5746

Props WCUADD

Note: See TracTickets for help on using tickets.