This morning I started seeing a pile of errors on my bbPress installations, starting with:

Warning: Invalid argument supplied for foreach() in /bb-settings.php on line 173

This caused a cascade of other errors, prevented login to either the forum or the admin area and generally fubar’d everything. Since it took me over an hour to find a fix (way too long for such a big bug) I’m posting it here to hopefully help others find the solution.

Apparently it’s the result of a PHP upgrade to v5.2.5 last night. It would have been nice if my host had let me know they were doing this ahead of time. Thankfully, it seems only my bbPress installations are affected.

The fix

From a post in the bbPress forums by Neziniux, originally linked from a German post:

Open bb-settings.php, on line 172 find:

if ( is_callable( 'glob' ) )
foreach ( glob(BBPLUGINDIR . '_*.php') as $_plugin )
require($_plugin);

Replace with

if ( is_callable( 'glob' ) ) {
$pluginarray = glob(BBPLUGINDIR . '_*.php');
if ($pluginarray)
foreach ( $pluginarray as $_plugin )
require($_plugin);
}

That’ll take care of it. Thanks to Neziniux and brusdeylins for this.

One Response to “bbPress v0.8.3.1 plugin error fix”


  1. 03/10/2008 at 4:29 am shanmuganathan

    simple and super explanation

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>