Skip to:
Content

BuddyPress.org

Changeset 2797


Ignore:
Timestamp:
03/02/2010 11:18:53 PM (16 years ago)
Author:
johnjamesjacoby
Message:

All field types should only return false if they are required and are empty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile.php

    r2784 r2797  
    727727        $field = new BP_XProfile_Field( $field_id );
    728728
    729         /* Check the value is an acceptable value */
     729        /* Check that value is acceptable */
    730730        if ( 'checkbox' == $field->type || 'radio' == $field->type || 'selectbox' == $field->type || 'multiselectbox' == $field->type ) {
    731731                $options = $field->get_children();
     732
     733                /* Not required fields can have empty value */
     734                if ( !$is_required )
     735                        $possible_values[] = '';
    732736
    733737                foreach( $options as $option )
     
    740744                        }
    741745
    742                         if ( empty( $value ) )
     746                        /* Field must be required to trigger error */
     747                        if ( $is_required && empty( $value ) )
    743748                                return false;
    744749
Note: See TracChangeset for help on using the changeset viewer.