Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#6137 closed defect (bug) (fixed)

xprofile_insert_field() & BP_XProfile_Field->save() work incorrectly

Reported by: slaFFik Owned by: boonebgorges
Priority: high Milestone: 2.3
Component: Extended Profile Version:
Severity: normal Keywords: needs-unit-tests
Cc:

Description

When you pass is_default_option to xprofile_insert_field() function, it's not saved into the DB.
Reason: xprofile_insert_field() initializes and pass is_default_option (among others) to BP_XProfile_Field and to its save() method, but there is no use or even mention of is_default_option.

So it's impossible right now using xprofile_insert_field() to save options defaults for fields. Currently we need to use additional xprofile_field_default_before_save filter for that.

OR

We need to have a separate function like xprofile_insert_field_option() that will flatten that (rather) complicated logic in BP_XProfile_Field->save() around options saving.

Change History (3)

#2 @DJPaul
12 years ago

  • Keywords needs-unit-tests added
  • Milestone Awaiting Review → 2.3
  • Priority normal → high

#3 @boonebgorges
12 years ago

  • Owner set to boonebgorges
  • Resolution → fixed
  • Status new → closed

In 9710:

Process is_default_option properly in xprofile_insert_field() and BP_XProfile_Field::save().

Previously, it was being ignored, which meant there was no way to change
is_default_option within the API.

Fixes #6137.

Note: See TracTickets for help on using tickets.