WordPress.org

Ready to get started?Download WordPress

Forums

Graphene
WordPress database error from graphene_get_comment_count() (2 posts)

  1. J.D. Grimes
    Member
    Posted 1 year ago #

    I am getting the following error logged each time I visit the the Dashboard screen on the administration side of the site:

    [23-Jun-2013 21:12:19 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 '' at line 7 for query
            SELECT
                COUNT(comment_ID)
            FROM
                ds_comments
            WHERE
                comment_type = "" AND comment_approved="1" AND comment_parent="0"  AND
                comment_post_ID=  made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/graphene/404.php'), get_header, locate_template, load_template, require_once('/themes/graphene/header.php'), wp_head, do_action('wp_head'), call_user_func_array, wp_enqueue_scripts, do_action('wp_enqueue_scripts'), call_user_func_array, graphene_localize_scripts, graphene_get_comment_count

    This is happening because graphene_get_comment_count() uses get_post_ID(), which won't work on the admin side. Adding this to the top of the function fixes the bug:

    if ( ! get_the_ID() )
          return;

    Thanks.

  2. phil_trottier
    Member
    Posted 1 year ago #

    Same here. This didn't happen before upgrade to WordPress version 3.5.2 though...

    Thanks for the fix.

    I posted in the Graphene forum:
    http://forum.graphene-theme.com/bug-report/wordpress-database-error-since-upgrading-to-wordpress-352

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic