Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

#3929 closed defect (bug) (fixed)

Suppress warnings when $members_template->member->profile_data keys are not set

Reported by: CoenJacobs Owned by:
Milestone: 1.6 Priority: normal
Severity: normal Version: 1.5
Component: Members Keywords: has-patch
Cc:

Description

In bp-members/bp-members-template.php two keys of $members_template->member->profile_data are called (field_type and field_data), even if they are not set. This results in notices which can easily be prevented.

Attachments (1)

3929.diff (891 bytes) - added by CoenJacobs 10 years ago.
Suppress notices

Download all attachments as: .zip

Change History (6)

@CoenJacobs
10 years ago

Suppress notices

#1 @CoenJacobs
10 years ago

  • Summary changed from Surpress warnings when $members_template->member->profile_data keys are not set to Suppress warnings when $members_template->member->profile_data keys are not set

#2 follow-up: @DJPaul
10 years ago

  • Component changed from Core to Members
  • Keywords reporter-feedback added; dev-feedback removed
  • Milestone changed from Awaiting Review to 1.6

Patch is valid but I'm interested in how this error is being triggered. Are you adding custom profile field types, or filtering the results?

#3 in reply to: ↑ 2 @CoenJacobs
10 years ago

  • Keywords reporter-feedback removed

Replying to DJPaul:

Patch is valid but I'm interested in how this error is being triggered. Are you adding custom profile field types, or filtering the results?

I'm simply calling it like this:

bp_member_profile_data( 'field=Location' );

#4 @CoenJacobs
10 years ago

To add to this, I'm calling that function in a pretty straight forward loop:

while ( bp_members() ) : bp_the_member();

#5 @djpaul
10 years ago

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

(In [5646]) Prevent PHP Notices when retrieving a user's profile field that hasn't had a value set. Fixes #3929, props CoenJacobs for initial patch

Note: See TracTickets for help on using tickets.