Skip to:
Content

BuddyPress.org

Changeset 6117


Ignore:
Timestamp:
06/19/2012 12:18:19 PM (14 years ago)
Author:
boonebgorges
Message:

In xprofile_admin_manage_field(), make sure $field_id is set before setting meta

When creating a new profile field, it's necessary to ensure that $field_id is
set, or calls to bp_xprofile_update_meta() and related wrapper functions will
fail. That means that, eg, field visibility settings are not properly stored
on the initial field creation. This changeset fixes the problem by ensuring
that $field_id has been populated before carrying on with the setup routine.

See #4275

Props imath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r5797 r6117  
    258258            }
    259259
    260             if ( !$field->save() ) {
     260            // For new profile fields, set the $field_id. For existing profile fields,
     261            // this will overwrite $field_id with the same value.
     262            $field_id = $field->save();
     263
     264            if ( !$field_id ) {
    261265                $message = __( 'There was an error saving the field. Please try again', 'buddypress' );
    262266                $type = 'error';
Note: See TracChangeset for help on using the changeset viewer.