Skip to:
Content

BuddyPress.org

Ticket #6244: 6244.patch

File 6244.patch, 1.5 KB (added by imath, 11 years ago)
  • src/bp-core/admin/bp-core-admin-components.php

    diff --git src/bp-core/admin/bp-core-admin-components.php src/bp-core/admin/bp-core-admin-components.php
    index ba868a8..434c152 100644
    function bp_core_admin_get_active_components_from_submitted_settings( $submitted 
    299299                $current_action = $_GET['action'];
    300300        }
    301301
    302         $current_components = buddypress()->active_components;
     302        $current_components       = buddypress()->active_components;
     303        $packaged_components      = array_flip( bp_core_get_packaged_component_ids() );
     304        $custom_active_components = array_diff_key( $current_components, $packaged_components );
    303305
    304306        switch ( $current_action ) {
    305307                case 'retired' :
    function bp_core_admin_get_active_components_from_submitted_settings( $submitted 
    307309                        foreach ( array_keys( $retired_components ) as $retired_component ) {
    308310                                if ( ! isset( $submitted[ $retired_component ] ) ) {
    309311                                        unset( $current_components[ $retired_component ] );
     312
     313                                        // Make sure custom components does not contain a retired component
     314                                        if ( isset( $custom_active_components[ $retired_component ] ) ) {
     315                                                unset( $custom_active_components[ $retired_component ] );
     316                                        }
    310317                                }
    311318                        }
    312319                        // fall through
    function bp_core_admin_get_active_components_from_submitted_settings( $submitted 
    322329                        break;
    323330        }
    324331
    325         return $components;
     332        // Active components is the list of packaged and custom components
     333        return array_merge( $components, $custom_active_components );
    326334}
    327335
    328336/**