Skip to:
Content

BuddyPress.org

Changeset 11409


Ignore:
Timestamp:
02/02/2017 09:08:02 AM (3 years ago)
Author:
offereins
Message:

XProfile: keep the field order value on save

Fixes a bug where the group's first field would be pushed to the bottom of
the field order stack on field save.

Fixes #7428

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-admin.php

    r11374 r11409  
    374374
    375375            $field->field_order = $wpdb->get_var( $wpdb->prepare( "SELECT field_order FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ) );
    376             if ( empty( $field->field_order ) || is_wp_error( $field->field_order ) ) {
     376            if ( ! is_numeric( $field->field_order ) || is_wp_error( $field->field_order ) ) {
    377377                $field->field_order = (int) $wpdb->get_var( $wpdb->prepare( "SELECT max(field_order) FROM {$bp->profile->table_name_fields} WHERE group_id = %d", $group_id ) );
    378378                $field->field_order++;
Note: See TracChangeset for help on using the changeset viewer.