Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/01/2014 10:33:57 PM (12 years ago)
Author:
djpaul
Message:

xProfile: prevent duplicate profile field templating when using pre-2.0 custom field types.

Prior to the xProfile field type overhaul in 2.0, plugins that added custom field types had to do so with a variety of actions.
One such plugin is "Buddypress Xprofile Custom Fields Type" and the changes in 2.0 caused an issue where the plugin's custom
templating was being rendered, alongside BuddyPress' profile field fallback type, the textbox.

BuddyPress uses a fallback field type to handle situations when extra profile types/data are provided by another plugin, and
then that plugin is removed. The original idea was that everything would fallback to rendering a textbox if a field type was
unregistered to give at least some kind of access to that profile field's data, but in practice this has caused a couple of
issues with templating, as this commit addresses.

This change essentially reverts the fallback behaviour to the pre-2.0 implementation: if a custom field type is unknown to
BuddyPress, that field simply won't be rendered.

Fixes #5589

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/testcases/xprofile/class-bp-xprofile-field-type.php

    r8295 r8336  
    1515    public function test_unregistered_field_type_returns_textbox() {
    1616        $field = bp_xprofile_create_field_type( 'fakeyfield' );
    17         $this->assertEquals( get_class( $field ), 'BP_XProfile_Field_Type_Textbox' );
     17        $this->assertEquals( get_class( $field ), 'BP_XProfile_Field_Type_Placeholder' );
    1818    }
    1919
Note: See TracChangeset for help on using the changeset viewer.