Skip to:
Content

BuddyPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7073 closed defect (bug) (fixed)

Move cache setting in class-bp-xprofile-field::get_instance() under check for if query was successful

Reported by: mmcachran Owned by: boonebgorges
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

This will avoid errors like:
Notice: Trying to get property of non-object in /srv/www/wp/htdocs/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-field.php on line 237

Attachments (1)

bp.diff (570 bytes) - added by mmcachran 4 years ago.
updates for class-bp-xprofile-field.php

Download all attachments as: .zip

Change History (4)

@mmcachran
4 years ago

updates for class-bp-xprofile-field.php

#1 @boonebgorges
4 years ago

  • Milestone changed from Awaiting Review to 2.6
  • Owner set to boonebgorges
  • Status changed from new to assigned

It looks like this is your first contribution to BuddyPress. Welcome, and thanks! A good catch.

#2 @boonebgorges
4 years ago

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

In 10778:

XProfile: Only cache field object when query is successful.

Previously, a PHP notice was being thrown when a bad $field_id was passed
to BP_XProfile_Field::get_instance().

Props mmcachran.
Fixes #7073.

#3 @DJPaul
4 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.