Skip to:

Error messages with bbPress and WP’s WP_CACHE

  • r-a-y



    I get the following errors when using bbPress:

    Warning: array_map() [function.array-map]: Argument #2 should be an array in /var/www/ on line 71

    Warning: join() [function.join]: Bad arguments. in /var/www/ on line 71

    Warning: Invalid argument supplied for foreach() in /var/www/ on line 85

    I’m using bbPress 1.0 alpha 6 and I should also mention that I have integrated BuddyPress and WordPress MU and enabled WordPress’ WP_CACHE as stated here:

    Does that have anything to do with the error messages?

    Thanks for reading!

Viewing 21 replies - 1 through 21 (of 21 total)

  • r-a-y


    I forgot to mention that this error appears on the front page of bbPress.

    If I enter a forum or topic, the error is gone.

    Any idea how I can troubleshoot these errors?

    If you turn off WP_CACHE, does the error go away?

    You should really move to a newer version, preferably trunk.


    Does your message imply that if we use trunk, then WordPress static caching will work in bbPress?



    @johnhiler, I have two test environments.

    One is on my localbox, which doesn’t have WP_CACHE enabled.

    The second is my development server, which has WP_CACHE enabled.

    I should add that I’m using deep integration between WPMU 2.7.1 and bbPress 1.0 alpha 6.

    The problem only occurs on the development server, which leads me to infer that it only happens when WP_CACHE is enabled. However, I’ll turn WP_CACHE off and let you know what happens.

    @sambauers, BuddyPress + WPMU 2.7.1 + bbPress integration works really well on bbPress 1.0 alpha 6 (cookies and all). I haven’t upgraded because I’m afraid I will break integration somehow.

    If I were to upgrade, it will be when bbPress reaches version 1 status and when other BP developers can test out all the kinks involved with integration.

    That article on the BuddyPress Codex is a little confused.

    Are you using WP-Super-Cache (output caching) or an object based cache like the memcached object cache?

    There have been significant changes in the file where your errors turned up (exactly around those lines).

    There is a good chance that the problem no longer exists, but please give us a bit more info to go on.


    Are you using the WP Super Cache (output cache) with success?

    If so, I would be EXTREMELY interested in know how you got it to work.

    Frooyo – I think the WP Super Cache is just being used on top of WordPress MU, which is the core engine for BuddyPress…



    Hi Sam,

    Sorry for not being clear.

    I’m using object cache and not WP Super Cache.


    Since I’ve never developed a plugin for bbPress before …

    Does anyone mind pointing me in the direction of where I should begin.

    I would like to attempt to port WordPress Super Cache (output cache) plugin to bbPress for non-logged in users.

    Visit the WordPress Codex and search for information on apply_filters().

    You can filter that array with a simple plugin.


    OK then, you really need to upgrade.

    Here’s how I would do it…

    1. De-integrate cookies, clear out all cookie settings in bbPress/WordPress including hardcoded ones in configs with the exception of you secret keys (BB_AUTH_KEY and friends)
    2. Upgrade to the latest Trunk of bbPress
    3. Upgrade to the latest release of the bbPress Integration plugin
    4. Clear all relevant cookies in your browser
    5. Setup integration in WordPress first, go to the admin panel for the plugin – use the settings it gives you to use in your wp-config.php file
    6. Setup integration in bbPress second, if the plugin in WordPress tells you to add a special constant to bb-config.php, do that now too. You’ll need to login to bbPress separately at this stage. Only enter settings into the admin, don’t try to add anything back into your bb-config.php except that one line from the WordPress plugin
    7. Now you should be good to go again, clear your browser cookies and try various ways to login and logout



    Hi Sam,

    Thanks for that detailed post. I’ve added this post to my favorites so I can come back to it.

    However, at this time, I’m not going to upgrade until bbPress reaches official version 1 status.

    I’ve temporarily gotten rid of the warning messages by doing the following:

    Line 71 of bbPress 1.o alpha 6:

    $_cached_ids = join( ',', array_map( 'intval', (array)$cached_ids ) );

    Lines 86-89 of bbPress 1.o alpha 6:

    if(!empty($cached_ids)) {
    foreach ( $cached_ids as $cached_id )
    $this->results[] = $trans[$cached_id];

    Yeah I know it isn’t ideal as I’m probably not using the latest, optimized build of bbPress, but it gets rid of the warning messages.


    Can you please do a var_dump($cached_ids) so we can find out exactly what the value of $cached_ids is?

    Just before line 71 in that file would be the spot, before $_cached_ids = join( ',', array_map( 'intval', $cached_ids ) );

    It should output something useful to the screen.

    It’s probably just FALSE

    You could also try restarting your memcached service to clear any potentially bad buffers.



    Hi Sam,

    Did the var_dump.

    Here’s the result:

    array(2) {
    string(1) "2"
    string(1) "1"
    string(0) ""


    I should state that I forgot to clear the memcached service. How do I go about doing that?

    Sam, I followed your instructions above for bbpress integration and it doesn’t work. The result is that if I login to bbpress, it logs me out of wpmu. If I login to wpmu it logs me out of bbpress.

    bbpress rc3 – trunk r2162

    bbpress Integration plugin 1.0-rc3

    wpmu 2.7.1 from the download zip

    All downloaded and installed fresh on my Windows dev box. I’ll come back to this after I’ve finished my post graduate work in particle physics.


    There is a major incompatibility between the memcached WP_Object_Cache class that is out there and BackPress. I’m about to add a newer class to BackPress itself that will replace the currently available one.

    Once that class is added to BackPress it should fix these problems and a few others I’ve found. You’ll be able to use the new class by adding the following define to your config:

    define( 'BB_OBJECT_CACHE_TYPE', 'memcached' );

    This will be part of bbPress 1.0




    Thanks for elaborating on this new class! Anxiously waiting for bbPress v1 :)


    Off-topic, but… wow! Post-grad particle physics?

Viewing 21 replies - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.
Skip to toolbar