Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#7154 closed enhancement (fixed)

bp_profile_get_field_groups() does not set `fields` property for xprofile groups without fields

Reported by: DJPaul Owned by: djpaul
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords:
Cc:

Description

When using bp_profile_get_field_groups, you get an array of objects for each profile field group. Within each object, there's a property fields which is an array of objects for the fields in that group.

However, if a field group has no fields, this fields property is not set. It really should be set as an empty array for consistency in its return types.

Change History (2)

#1 @DJPaul
3 years ago

  • Milestone changed from Future Release to 2.7

#2 @djpaul
3 years ago

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

In 10935:

xprofile: always initialise fields property when fetching field groups.

When using bp_profile_get_field_groups, xprofile field groups without any fields did not have a fields property set in the return value. This changes initialises the property to an empty array, to increase the data consistency of the results.

Fixes #7154

Note: See TracTickets for help on using tickets.