Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 8 years ago

#6165 closed enhancement (fixed)

Filter request in bp_get_member_profile_data()

Reported by: needle's profile needle Owned by: tw2113's profile tw2113
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords: has-patch commit
Cc:

Description

This is a follow-up to #5220, where Boone suggested a dynamic filter for bp_get_member_profile_data(). It looks like this filter was never implemented - which means that plugins cannot filter the value of an xProfile field by field-type when the data is fetched via this function. For consistency, it would be great to see the dynamic filter implemented.

Attachments (1)

6165-member-profile-fieldtype-filter.diff (1.0 KB) - added by tw2113 9 years ago.

Download all attachments as: .zip

Change History (7)

#1 @DJPaul
10 years ago

  • Milestone changed from Awaiting Review to Future Release

#2 @tw2113
9 years ago

Looks like it's causing failing tests at the moment, so don't mark as commit ready yet. Need to investigate why.

1) BP_Tests_XProfile_Functions::test_bp_get_member_profile_data_inside_loop
Array to string conversion

/srv/www/buddypress/htdocs/wp-content/buddypress-git-trunk/src/bp-members/bp-members-template.php:1159
/srv/www/buddypress/htdocs/wp-content/buddypress-git-trunk/tests/phpunit/testcases/xprofile/functions.php:539

2) BP_Tests_XProfile_Functions::test_bp_get_member_profile_data_outside_of_loop
Undefined index: Kewl

/srv/www/buddypress/htdocs/wp-content/buddypress-git-trunk/src/bp-members/bp-members-template.php:1159
/srv/www/buddypress/htdocs/wp-content/buddypress-git-trunk/tests/phpunit/testcases/xprofile/functions.php:562

#3 @tw2113
9 years ago

  • Keywords has-patch added
  • Milestone changed from Future Release to 2.7

Figured out the issue, I had a period instead of a comma separating $data and $r. Tests pass again.

#4 @DJPaul
9 years ago

  • Keywords commit added

Looks good!

#5 @DJPaul
9 years ago

  • Owner set to tw2113
  • Status changed from new to assigned

#6 @tw2113
8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 11011:

Adds new field type specific filter to bp_get_member_profile_data function for conditional filtering. Fixes #6165.

Note: See TracTickets for help on using tickets.