Skip to:
Content

BuddyPress.org

Ticket #7428: 7428.01.patch

File 7428.01.patch, 822 bytes (added by Offereins, 3 years ago)
  • src/bp-xprofile/bp-xprofile-admin.php

    diff --git a/src/bp-xprofile/bp-xprofile-admin.php b/src/bp-xprofile/bp-xprofile-admin.php
    index 922d380..0bcefb2 100644
    a b function xprofile_admin_manage_field( $group_id, $field_id = null ) { 
    373373                        }
    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++;
    379379                        }