Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/15/2014 12:51:03 PM (11 years ago)
Author:
boonebgorges
Message:

Add 'option' to the whitelist of xprofile field types

The 'option' field type is not full-fledged, in the sense that it has an
associated BP_XProfile_Field_Type class; it is used only to save the values
that are child options of type 'radio', 'select', 'multiselect' and other
option-supporting field types. It is important that 'option' thus be added
manually to the field type whitelist, so that option fields can be created
programatically.

Fixes #5472

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/xprofile/functions.php

    r8178 r8518  
    569569        $this->assertEquals( 0, xprofile_get_field_data( 'Pens', $u ) );
    570570    }
     571
     572    /**
     573     * @group xprofile_insert_field
     574     */
     575    public function test_xprofile_insert_field_type_option() {
     576        $g = $this->factory->xprofile_group->create();
     577        $parent = $this->factory->xprofile_field->create( array(
     578            'field_group_id' => $g,
     579            'type' => 'selectbox',
     580            'name' => 'Parent',
     581        ) );
     582
     583        $f = xprofile_insert_field( array(
     584            'field_group_id' => $g,
     585            'parent_id' => $parent,
     586            'type' => 'option',
     587            'name' => 'Option 1',
     588            'field_order' => 5,
     589        ) );
     590
     591        $this->assertNotEmpty( $f );
     592    }
    571593}
Note: See TracChangeset for help on using the changeset viewer.