Skip to:
Content
Pages
Categories
Search
Top
Bottom

Query error


  • kbaldac
    Participant

    @kbaldac

    We are running WordPress 4.7.3 with bbpress 2.5.12 at http://one-name.org. This mysql error started appearing last night when accessing any forum, topic or reply. I believe it relates to the ‘AND ((()))’ clause:

    Apr 06, 13:03:46
    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘))) AND ggx_posts.post_type IN (‘topic’, ‘reply’) AND (ggx_posts.post_status = ‘ at line 1 for query SELECT ggx_posts.* FROM ggx_posts FORCE INDEX (PRIMARY, post_parent) WHERE 1=1 AND (ggx_posts.ID = 29822 OR ggx_posts.post_parent = 29822) AND ((())) AND ggx_posts.post_type IN (‘topic’, ‘reply’) AND (ggx_posts.post_status = ‘publish’ OR ggx_posts.post_status = ‘closed’ OR ggx_posts.post_status = ‘retained’ OR ggx_posts.post_author = 5528 AND ggx_posts.post_status = ‘private’ OR ggx_posts.post_author = 5528 AND ggx_posts.post_status = ‘hidden’) ORDER BY ggx_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

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

  • bjorngus
    Participant

    @bjorngus

    Hi, i have the same error after only updating wordpress, not bbpress. Any solution to this ?
    SQL is triggered in bbp_has_replies in wp-content/plugins/bbpress/includes/replies/template.php but it has not changed.


    bjorngus
    Participant

    @bjorngus

    Ok, i have something that seems to work, try it out if you want to, feel free to give me feedback on it.

    function fix_default_search_string_is_bool($args)
    {
        //bbpress gives FALSE as search string causing no replys to show, this fixes it.
        if ($args['s'] === false) {
            unset($args['s']);
        }
        return $args;
    }
    
    add_filter('bbp_after_has_replies_parse_args', 'fix_default_search_string_is_bool');

    arjunrahul77
    Participant

    @arjunrahul77

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