WordPress.org

Support

Support » Plugins and Hacks » BuddyPress Activation outputs Warning: Creating default object from empty value

BuddyPress Activation outputs Warning: Creating default object from empty value

  • I’m running a fresh installation of WordPress Multisite on a CentOS 5 server (MySQL 5.5 and PHP 5.4).

    I’ve just installed BuddyPress but get a series of errors when I activate it, all beginning:

    “Warning: Creating default object from empty value <file>”

    I’ve seen this elsewhere on the forums but no real solutions. I get the same errors with all plugins disabled and on TwentyTen theme. I’ve also played around with file/dir permissions and ruled that out.

    Could it be an issue with my database setup/configuration?

Viewing 6 replies - 1 through 6 (of 6 total)
  • I have the same problem, using PHP 5.4 (on Windows), I suggest using PHP 5.3 or changing core files manually. Have the same problem with Akismet and bbPress. For bbPress I found a patch:
    http://bbpress.trac.wordpress.org/attachment/ticket/1801/0001-patched-bbpress-theme-compat-for-5.4-warning-concern.patch
    similar changes could be done to wordpress core to fix it I guess.

    Basically, before the line with the error, you need to insert:

    if (!is_object($bbp->CLASS)) {
        $bbp->CLASS = new stdClass;
    }

    for example for line:
    $bbp->theme_compat->theme = $theme;
    you do this:

    if (!is_object($bbp->theme_compat)) {
        $bbp->theme_compat = new stdClass;
    }
    $bbp->theme_compat->theme = $theme;

    Thanks for the reply, I’m just about to try it.

    I can’t run PHP 5.3 as I’m also running a Moodle installation on this server (the latest version of) which requires 5.4.

    Nope. No luck. The line that seems to be causing the problem is line 71 on bp-loader.php:

    if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) {

    My guess you used $bp->database_version.
    You should use $bp instead. For line 71 in bp-loader.php the fix is:

    if (!is_object($bp)) {
    	$bp = new stdClass;
    }

    Put this just before the line 71. Worked for me.

    Aha! I had tried this:
    This did not work

    if (!is_object($bp->database_version)) {
        $bp->database_version = new stdClass;
    }
    if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) {

    This fixed everything!

    if (!is_object($bp)) {
    	$bp = new stdClass;
    }
    if ( !$bp->database_version = get_site_option( 'bp-db-version' ) ) {

    Thanks dude!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘BuddyPress Activation outputs Warning: Creating default object from empty value’ is closed to new replies.
Skip to toolbar