Skip to:
Content

BuddyPress.org

Ticket #5553: 5553.05.diff

File 5553.05.diff, 956 bytes (added by imath, 11 years ago)
  • bp-core/bp-core-update.php

    diff --git bp-core/bp-core-update.php bp-core/bp-core-update.php
    index 8b1f30e..79476ae 100644
    function bp_update_to_2_0() { 
    358358                        bp_core_install_signups();
    359359                }
    360360
    361                 $signups = get_users( array(
    362                         'fields'       => 'all_with_meta',
    363                         'meta_key'     => 'activation_key',
    364                         'meta_compare' => 'EXISTS',
    365                 ) );
     361                $status_2_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->users} WHERE user_status = '2'" );
    366362
    367                 if ( empty( $signups ) ) {
     363                if ( ! empty( $status_2_ids ) ) {
     364                        $signups = get_users( array(
     365                                'fields'  => 'all_with_meta',
     366                                'include' => $status_2_ids,
     367                        ) );
     368                } else {
    368369                        return;
    369370                }
    370371
    371372                foreach ( $signups as $signup ) {
    372373                        $meta = array();
    373374
     375                        if ( empty( $signup->activation_key ) )
     376                                $signup->activation_key = wp_hash( $signup->ID );
     377
    374378                        if ( bp_is_active( 'xprofile' ) ) {
    375379                                $meta['field_1'] = $signup->display_name;
    376380                        }