Forums

Join
bbPress Support ForumsTroubleshootingCall to undefined function: add_option()

Info

Call to undefined function: add_option()

  1. I'm using bbPress RC2 integrated with WPMU 2.7.1 (cookie sharing & user table sharing). I recently updated from RC1 to RC2 and since then I sometimes (not always) get the following error message:

    Fatal error: Call to undefined function: add_option() in /[full path to bbpress]/bb-includes/backpress/class.wp-http.php on line 655

    As soon as I reload the page, the error vanishes. What might be the reason?

    If it helps: I due have the slight suspicion that the error is more likely to appear when there hasn't been an access to bbpress for some time. But it's hard to tell...

  2. For the time being I could fix the problem. Since I do not know what the implications are, it would probably still be better if one of you guys would take a look on it.

    Line 654 and 655 are:

    if ( true === $elapseDelay )
    add_option( 'disable_fsockopen', $endDelay, null, true );

    Since the forum works fine most of the time, I assume that add_option thing isn't terribly important, so I just extended the if statement:

    if ( true === $elapseDelay && function_exists("add_option"))

    Couldn't see any negative side effects yet, but since this error only appeared sometimes this might be an illusion. :) In any way I have no idea what this is supposed to do in the first place, so it's a bit of blind hacking...

  3. Change that add_option() to backpress_add_option()

    This is now fixed in trunk.

  4. Thanks. I manually added your fix to my installation and it seems to work fine. :)

  5. You must log in to post.