Hello I got this error when I add wpForo Widget to the Sidebar
Here is an example of wpForo Recent Post widget:
Fatal error: Call to a member function get_var() on null in/home/l9twhstvd/public_html/wp-content/plugins/wpforo/wpf-includes/class-posts.php on line 287
Here is the line 287:
$items_count = $this->wpforo->db->get_var(preg_replace('#SELECT.+?FROM#isu', 'SELECT count(*) FROM', $sql));
This error happen with all the wpForo Widget at Sidebar in Forum page, they are work in Homepage.
Please help me to solve this error. Thanks
Hi dtmloc,
plugin is updated, please deactivate, delete then search and install wpForo again. Don't forget delete all caches.
Hi Robert,
I notice that you changed some code in line 287 at wpforo/wpf-includes/class-posts.php. However, the Fatal error now is line 288, here is the full error:
Fatal error: Call to a member function get_var() on null in/home/l9twhstvd/public_html/wp-content/plugins/wpforo/wpf-includes/class-posts.php on line 288
- line 287:
$item_count_sql = preg_replace('#SELECT.+?FROM#isu', 'SELECT count(*) FROM', $sql);
- line 288:
if( $item_count_sql ) $items_count = $this->wpforo->db->get_var($item_count_sql);
- and widget still work in Homepage, not work in Forum page. Sorry to bother you, but please help me to fix this problem, thanks you so much 🙂
What do you mean saying doesn't work? Could you please remove and add again forum widgets? Please leave some URL or screenshot to allow us see what's going on your website.
This is my Homepage URL: http://l9twhstvd-site.ftempurl.com/ . You can see the Recent Post Widget work perfectly
This is my Forum page URL: http://l9twhstvd-site.ftempurl.com/community/ . You can see the error at Recent Post Widget
Many thanks for your advices 🙂