Skip to:
Content

bbPress.org

Opened 12 years ago

Closed 12 years ago

#1955 closed defect (bug) (fixed)

Bug in form-user-edit.php file.

Reported by: plescheff's profile plescheff Owned by:
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.1.2
Component: Component - Users Keywords:
Cc:

Description

Using bbPress 2.1.2, WordPress 3.4.2.

Needed to add some custom contact fields to user profile. User edit form won't show custom contact fields after save.

Steps to reproduce..
Add these lines to functions.php :

add_filter('user_contactmethods', 'ztwp_extra_user_contactmethods');
function ztwp_extra_user_contactmethods() {
    return array('phone' => __('Phone'));
}
function ztwp_save_extra_user_profile_fields( $user_id ) {
    if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }
    update_user_meta( $user_id, 'phone', $_POST['phone'] );
}

Open user profile via bbPress. You should see field for phone number. Enter phone no and save. After save you won't see the number prefilled in the field. The number was saved nevertheless (check user profile via wp-admin).

I found and fixed the bug. Please include this in your next releases.

Patch for file wp-content/plugins/bbpress/bbp-theme-compat/bbpress/form-user-edit.php (line 62):

--- <input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( bbp_get_displayed_user_field( 'name' ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />
+++ <input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( bbp_get_displayed_user_field( $name ) ); ?>" class="regular-text" tabindex="<?php bbp_tab_index(); ?>" />

Change History (2)

#1 @johnjamesjacoby
12 years ago

  • Component changed from General to Users
  • Milestone changed from Awaiting Review to 2.2

#2 @johnjamesjacoby
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4227]) User Edit:

  • Use $name variable instead of literal 'name' text in form-user-edit.php.
  • Fixes issue with displaying and saving extra user contact methods.
  • Fixes #1955.
  • Props piecheff.
Note: See TracTickets for help on using tickets.