Ticket #2947: 2947.001.patch
File 2947.001.patch, 3.5 KB (added by , 14 years ago) |
---|
-
buddypress/bp-xprofile/bp-xprofile-templatetags.php
187 187 if ( $class ) 188 188 $css_classes[] = sanitize_title( esc_attr( $class ) ); 189 189 190 / * Set a class with the field ID */190 // Set a class with the field ID 191 191 $css_classes[] = 'field_' . $profile_template->field->id; 192 192 193 / * Set a class with the field name (sanitized) */193 // Set a class with the field name (sanitized) 194 194 $css_classes[] = 'field_' . sanitize_title( $profile_template->field->name ); 195 195 196 196 if ( $profile_template->current_field % 2 == 1 ) … … 387 387 $option_values = maybe_unserialize( BP_XProfile_ProfileData::get_value_byid( $options[$k]->parent_id ) ); 388 388 $option_values = (array)$option_values; 389 389 390 / * Check for updated posted values, but errors preventing them from being saved first time */390 // Check for updated posted values, but errors preventing them from being saved first time 391 391 foreach( (array)$option_values as $i => $option_value ) { 392 392 if ( isset( $_POST['field_' . $field->id] ) && $_POST['field_' . $field->id] != $option_value ) { 393 393 if ( !empty( $_POST['field_' . $field->id] ) ) … … 411 411 for ( $k = 0; $k < count($options); $k++ ) { 412 412 $option_value = BP_XProfile_ProfileData::get_value_byid($options[$k]->parent_id); 413 413 414 / * Check for updated posted values, but errors preventing them from being saved first time */414 // Check for updated posted values, but errors preventing them from being saved first time 415 415 if ( isset( $_POST['field_' . $field->id] ) && $option_value != $_POST['field_' . $field->id] ) { 416 416 if ( !empty( $_POST['field_' . $field->id] ) ) 417 417 $option_value = $_POST['field_' . $field->id]; … … 432 432 case 'checkbox': 433 433 $option_values = BP_XProfile_ProfileData::get_value_byid($options[0]->parent_id); 434 434 435 / * Check for updated posted values, but errors preventing them from being saved first time */435 // Check for updated posted values, but errors preventing them from being saved first time 436 436 if ( isset( $_POST['field_' . $field->id] ) && $option_values != maybe_serialize( $_POST['field_' . $field->id] ) ) { 437 437 if ( !empty( $_POST['field_' . $field->id] ) ) 438 438 $option_values = $_POST['field_' . $field->id]; … … 454 454 break; 455 455 456 456 case 'datebox': 457 $date = BP_XProfile_ProfileData::get_value_byid($field->id); 457 458 458 if ( !empty( $ field->data->value ) ) {459 $day = date("j", $ field->data->value);460 $month = date("F", $ field->data->value);461 $year = date("Y", $ field->data->value);459 if ( !empty( $date ) ) { 460 $day = date("j", $date); 461 $month = date("F", $date); 462 $year = date("Y", $date); 462 463 $default_select = ' selected="selected"'; 463 464 } 464 465 465 / * Check for updated posted values, but errors preventing them from being saved first time */466 // Check for updated posted values, but errors preventing them from being saved first time 466 467 if ( !empty( $_POST['field_' . $field->id . '_day'] ) ) { 467 468 if ( $day != $_POST['field_' . $field->id . '_day'] ) 468 469 $day = $_POST['field_' . $field->id . '_day']; … … 529 530 break; 530 531 } 531 532 532 apply_filters( 'bp_get_the_profile_field_datebox', $html, $day, $month, $year, $default_select );533 533 534 $html = apply_filters( 'bp_get_the_profile_field_datebox', $html, $type, $day, $month, $year, $default_select ); 534 535 break; 535 536 } 536 537