I am having quite a similar problem. I traced the code and found out that adding a line
$database->connect();
at the end of my code will fix it.
It seems that only one connection can be open at a time so you need to close the one you opened and reopen WB's connection.
It seems that the crashing instruction is in file
filter-routines.php line 35 which is a query to the WB db. I wonder if it would not be a good idea to ensure that the WB db keeps connected after showing some processed output by adding this line in file
\wb\index.php (which is where the initial call which causes the crash is originated) at line 99:
93: if(function_exists('filter_frontend_output')) {
94: // store output in variable for filtering
95: @ob_start();
96: require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
97: $frontend_output = ob_get_contents();
98: @ob_end_clean();
99: // Ensure we are connected to WB's db before further processing!
100: $database->connect();
// Display the filtered output on the frontend
echo filter_frontend_output($frontend_output);
die;
}
Could someone confirm this is correct?
Thanks!