Skip to:
Content

BuddyPress.org

Changeset 4992


Ignore:
Timestamp:
08/16/2011 08:31:07 PM (15 years ago)
Author:
boonebgorges
Message:

Adds Components step into upgrade Wizard when coming from pre-1.5, so that active components are properly migrated from bp-deactivated-components (and are activated in the correct order). Fixes #3480

Location:
trunk/bp-core/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-admin.php

    r4973 r4992  
    343343        );
    344344
    345         if ( is_multisite() )
    346                 $optional_components['blogs']['description'] = __( 'Make BuddyPress aware of new sites, new posts and new comments from across your entire network.', 'buddypress' );
     345        if ( is_multisite() )
     346                $optional_components['blogs']['description'] = __( 'Make BuddyPress aware of new sites, new posts and new comments from across your entire network.', 'buddypress' );
     347
     348        // If this is an upgrade from before BuddyPress 1.5, we'll have to convert deactivated
     349        // components into activated ones
     350        if ( empty( $active_components ) ) {
     351                $deactivated_components = bp_get_option( 'bp-deactivated-components' );
     352
     353                // Trim off namespace and filename
     354                $trimmed = array();
     355                foreach ( (array) $deactivated_components as $component => $value ) {
     356                        $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
     357                }
     358
     359                // Loop through the optional components to create an active component array
     360                foreach ( (array) $optional_components as $ocomponent => $ovalue ) {
     361                        if ( !in_array( $ocomponent, $trimmed ) ) {
     362                                $active_components[$ocomponent] = 1;
     363                        }
     364                }
     365        }
    347366
    348367        // Required components
  • trunk/bp-core/admin/bp-core-update.php

    r4988 r4992  
    8585                                $steps[] = __( 'Database Update', 'buddypress' );
    8686
    87                         if ( $this->database_version < 1801 || !bp_core_get_directory_page_ids() )
     87                        if ( $this->database_version < 1801 || !bp_core_get_directory_page_ids() ) {
     88                                $steps[] = __( 'Components', 'buddypress' );
    8889                                $steps[] = __( 'Pages', 'buddypress' );
     90                        }
    8991
    9092                        $steps[] = __( 'Finish', 'buddypress' );
Note: See TracChangeset for help on using the changeset viewer.