Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/10/2016 09:51:13 PM (8 years ago)
Author:
djpaul
Message:

Core: Fix class autoloader behaviour during new installations.

This change for trunk adds members to the component whitelist within our autoloader implementation.

In r10918, we improved the class autoloader logic introduced in #6853 to support third-party plugins doing class_exists() checks for disabled components. However, new installations of BuddyPress still trigger fatal errors because we missed that the members component is always loaded, not just the core component.

Fixes #7153

Props DJPaul, slaFFik, offereins, mercime, svenl77, scharc, tomas711.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-loader.php

    r10940 r10942  
    619619        }
    620620
    621         // Sanity check 2 - Check if component is active before loading class.
    622         // Skip if PHPUnit is running.
    623         if ( 'core' !== $component && false === bp_is_active( $component ) && false === function_exists( 'tests_add_filter' ) ) {
     621        /*
     622         * Sanity check 2 - Check if component is active before loading class.
     623         * Skip if PHPUnit is running, or BuddyPress is installing for the first time.
     624         */
     625        if (
     626            ! in_array( $component, array( 'core', 'members' ), true ) &&
     627            ! bp_is_active( $component ) &&
     628            ! function_exists( 'tests_add_filter' )
     629        ) {
    624630            return;
    625631        }
Note: See TracChangeset for help on using the changeset viewer.