WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Activation outputs Warning: Creating default object from empty value (7 posts)

  1. John Peden
    Member
    Posted 1 year ago #

    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?

  2. leemour
    Member
    Posted 1 year ago #

    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.

  3. leemour
    Member
    Posted 1 year ago #

    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;
  4. John Peden
    Member
    Posted 1 year ago #

    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.

  5. John Peden
    Member
    Posted 1 year ago #

    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' ) ) {

  6. leemour
    Member
    Posted 1 year ago #

    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.

  7. John Peden
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic