Skip to:
Content

BuddyPress.org

Changeset 12981


Ignore:
Timestamp:
07/01/2021 08:50:32 AM (4 years ago)
Author:
imath
Message:

xProfile: make sure signup fields are ordered the right way

As the signup_position xProfile meta is stored as a LONGTEXT into the db table, we need to convert it to a SIGNED when using this data to order signup fields.

Props tamarazambrana, niftythree

Fixes #8500 (trunk)

File:
1 edited

Legend:

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

    r12885 r12981  
    14371437        $bp = buddypress();
    14381438
    1439         $signup_field_ids = $wpdb->get_col( "SELECT object_id FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND meta_key = 'signup_position' ORDER BY meta_value ASC" );
     1439        $signup_field_ids = $wpdb->get_col( "SELECT object_id FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND meta_key = 'signup_position' ORDER BY CONVERT(meta_value, SIGNED) ASC" );
    14401440
    14411441        wp_cache_set( 'signup_fields', $signup_field_ids, 'bp_xprofile' );
Note: See TracChangeset for help on using the changeset viewer.