Skip to:
Content
Pages
Categories
Search
Top
Bottom

Database error notice for bbPress and no forum/topics/replies showing/


  • HW
    Participant

    @hannahmwool

    Hi There,

    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

    Thanks!

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

  • HW
    Participant

    @hannahmwool

    Update: I used Query Monitor to get a better/nicer view of the database error. It appears there is some blank part “…AND ((())) AND…” see here: https://www.dropbox.com/s/pvrwhd5druvykus/Screen%20Shot%202017-04-04%20at%202.29.01%20PM.png?dl=0

    I resolved the topics and replies not displaying by using the wp4fix plugin here: http://www.rewweb.co.uk/bbpress-wp4-fix/ that had the issues with the search string. That was conflicting with Search Everything.

    Thanks!


    Robin W
    Moderator

    @robin-w

    Great – glad my fix helped, though without a full read, not quite sure why 🙂


    HW
    Participant

    @hannahmwool

    Thanks, Robin. It appears that the Search Everything plugin was causing the bbPress database error also. I’ve removed that plugin now so no longer require that fix (for now). 🙂

    My main issue with the forum page not showing the WordPress admin bar when logged in until you refresh the page is still happening with every plugin disabled.


    HW
    Participant

    @hannahmwool

    I actually just fixed my issue. It was an ExpiresByType line in .htaccess that was set to 1 month for text/html. I changed it to the below and it is now fixed.

    ExpiresByType text/html “access plus 0 seconds”


    crzyhrse
    Participant

    @crzyhrse

    I just want to thank @hannahmwool for this… I was having same database errors, and removing the Search Everything plugin fixed it totally…

    Much gratefulness…


    Robin W
    Moderator

    @robin-w

    thanks for sharing that this fixes 🙂

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