Database error notice for bbPress and no forum/topics/replies showing/
My client had reported a strange issue that started recently. If I navigate to the forum page, then login to WP, the WP admin bar displays at the top as normal. When I navigate back to the forum page after logging in, the admin bar does not show up on this page only until I refresh the page. At first I thought it was a caching issue with a Autoptimize cache plugin but it still occurs after I deactivate.
There is an error logging for bbPress repeatedly:
[04-Apr-2017 17:56:26 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘))) AND hn09m16p3_posts.post_type IN (‘topic’, ‘reply’) AND (hn09m16p3_posts.po’ at line 1 for query SELECT hn09m16p3_posts.* FROM hn09m16p3_posts FORCE INDEX (PRIMARY, post_parent) WHERE 1=1 AND (hn09m16p3_posts.ID = 8481 OR hn09m16p3_posts.post_parent = 8481) AND ((())) AND hn09m16p3_posts.post_type IN (‘topic’, ‘reply’) AND (hn09m16p3_posts.post_status = ‘publish’ OR hn09m16p3_posts.post_status = ‘closed’ OR hn09m16p3_posts.post_status = ‘reported’ OR hn09m16p3_posts.post_status = ‘acf-disabled’ OR hn09m16p3_posts.post_author = 217 AND hn09m16p3_posts.post_status = ‘private’ OR hn09m16p3_posts.post_author = 217 AND hn09m16p3_posts.post_status = ‘hidden’) ORDER BY hn09m16p3_posts.post_date ASC made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), apply_filters(‘template_include’), WP_Hook->apply_filters, call_user_func_array, bbp_template_include, apply_filters(‘bbp_template_include’), WP_Hook->apply_filters, call_user_func_array, bbp_template_include_theme_compat, BBP_Shortcodes->display_topic, bbp_get_template_part, bbp_locate_template, load_template, require(‘/plugins/bbpress/templates/default/bbpress/content-single-topic.php’), bbp_has_replies, WP_Query->__construct, WP_Query->query, WP_Query->get_posts
I used the repair forums tools one by one and now all the forums/topic/replies content is not displaying but the count is correct for each forum/topic, when I go into any of the forums/topics it says “Oh bother! No topics found here”.
I’m currently setting up a test site to strip it down and see if I can find the cause but I wanted to post this to make sure it isn’t a general bbPress issue with the SQL statement. Any help would be appreciated.
Wordpress version: 4.7.3
bbPress version: 2.5.12
- You must be logged in to reply to this topic.