Skip to:
Content

BuddyPress.org

Changeset 5949


Ignore:
Timestamp:
03/29/2012 01:19:42 PM (13 years ago)
Author:
boonebgorges
Message:

Fixes problems is bp_get_the_profile_field_options():

  • In 'checkbox' case, cast existing values as an array, to avoid misunderstandings with count() and in_array() later in the function
  • In 'checkbox' case, replace call to non-existent 'value' variable to something that makes sense in context
  • Clears up PHP warnings, and allows for better maintenance of existing values when switching between xprofile field types.

Fixes #4102

File:
1 edited

Legend:

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

    r5837 r5949  
    555555            case 'checkbox':
    556556                $option_values = BP_XProfile_ProfileData::get_value_byid( $field->id );
    557                 $option_values = maybe_unserialize( $option_values );
     557                $option_values = (array) maybe_unserialize( $option_values );
    558558
    559559                // Check for updated posted values, but errors preventing them from being saved first time
     
    575575
    576576                        // @todo $value is never created
    577                         if ( $option_values[$j] == $allowed_options || @in_array( $allowed_options, $value ) ) {
     577                        if ( $option_values[$j] == $allowed_options || @in_array( $allowed_options, $option_values ) ) {
    578578                            $selected = ' checked="checked"';
    579579                            break;
Note: See TracChangeset for help on using the changeset viewer.