• I’m upgraded to WordPress 4.0, am using version 0.57 of widget logic. The upgrade devastated my installation! Nothing comes up when I visit the home page, and this can be found in the error_log:

    [30-Sep-2014 21:02:17 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 1 for query SELECT post_parent FROM wp_posts WHERE ID = made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, wp_widgets_init, register_widget, WP_Widget_Factory->register, WP_Widget_Recent_Comments->__construct, is_active_widget, wp_get_sidebars_widgets, apply_filters(‘sidebars_widgets’), call_user_func_array, widget_logic_filter_sidebars_widgets, eval, get_parent_name_by_page_id

    https://wordpress.org/plugins/widget-logic/

Viewing 2 replies - 1 through 2 (of 2 total)
  • on the face of it, that doesn’t LOOK like a widget logic issue. it’s talking about a SQL error, and widget logic doesn’t play near DB stuff

    So are you saying that with widget logic deactivated the problem goes away?

    Thread Starter cheese63

    (@cheese63)

    Hi there, thanks for the response!

    It turns out there was a widget that had a custom function in it. The logic in the widget did something like this:

    function some_function($post_id)
    {
    //make a wordpress DB query using $post_id
    }
    global $post;
    some_function($post->ID);

    The problem is that $post, for the page being rendered, was an integer representing the post id, and not the actual $post object as would have been expected! Not sure why that is, but I got rid of the logic and everything worked again.

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

The topic ‘another broken in 4.0 post’ is closed to new replies.