Skip to:
Content

BuddyPress.org

Ticket #3153: aperture-science.patch

File aperture-science.patch, 1.4 KB (added by DJPaul, 15 years ago)
  • bp-core/admin/bp-core-update.php

     
    363363
    364364                $existing_pages = bp_core_update_get_page_meta();
    365365
    366                 // Get active components
    367                 $active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) );
     366                if ( 'update' == $this->setup_type ) {
     367                        // Pre-1.3 backwards compatibility
     368                        $old_deactivated_components = get_site_option( 'bp-deactivated-components' );
    368369
     370                        // Trim off namespace and filename
     371                        $trimmed = array();
     372                        foreach ( (array) $old_deactivated_components as $component => $value )
     373                                $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) );
     374
     375                        $active_components = array_flip( array_diff( array_values( array( 'members', 'groups', 'activity', 'forums', 'blogs', 'register', 'activate' ) ), array_values( $trimmed ) ) );
     376
     377                        // Loop through active components and set the values
     378                        foreach( $new_active_components as $component => $value )
     379                                $active_components[$component] = 1;
     380
     381                } else {
     382                        // Get active components
     383                        $active_components = apply_filters( 'bp_active_components', get_site_option( 'bp-active-components' ) );
     384                }
     385
    369386                // Check for defined slugs
    370387                $members_slug    = !empty( $bp->members->slug    ) ? $bp->members->slug    : __( 'members',  'buddypress' );
    371388