• Resolved 2startltd

    (@2startltd)


    Since updating the plugin to version 2.4.1 with WordPress version 6.2, the following error is occurring, on initial check, it looks like a DB column name has either changed or not updated correctly.

    PHP message: WordPress database error Unknown column 'business_id' in 'where clause' for query SELECT count(*) FROM wp_grp_google_review WHERE business_id = 6 made by do_action('wp_ajax_grw_feed_save_ajax'), WP_Hook->do_action, WP_Hook->apply_filters, WP_Rplg_Google_Reviews\Includes\Feed_Serializer_Ajax->save_ajax, WP_Rplg_Google_Reviews\Includes\Core\Core->get_reviews, WP_Rplg_Google_Reviews\Includes\Core\Core->get_data, WP_Rplg_Google_Reviews\Includes\Core\Core->get_google_reviews" while reading response header from upstream

    Looks like the column business_id has been renamed to google_place_id

    The issue looks to be within the class-core.php file on line 220.

    // Calculate Google reviews count
    if (isset($place->review_count) && $place->review_count > 0) {
                $review_count = $place->review_count;
            } else {
                $review_count = $wpdb->get_var(
                    $wpdb->prepare(
                        "SELECT count(*) FROM " . $wpdb->prefix . Database::REVIEW_TABLE .
                        " WHERE business_id = %d", $place->id
                    )
      );
    }

    Hope this helps resolve the bug currently being seen.

    • This topic was modified 1 year, 7 months ago by 2startltd.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author richplugins

    (@richplugins)

    Hi @2startltd,

    To investigate this question, please send to support[at]richplugins.com (NOT HERE) the debug information from the page: Google?Reviews / Settings / Advance tab. You need to click the ‘Copy Debug Information‘ button, paste copied to this reply and send?it to us.

    Thanks!

    Thread Starter 2startltd

    (@2startltd)

    Full details sent to the email as mentioned.
    I can also confirm my solution worked to fix the issue. by simply replacing the value busines_id on line 220 with google_place_id.

    Plugin Author richplugins

    (@richplugins)

    Hi @2startltd,

    Thank you for your help to bugfix! We will add this solution to the next version.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unknown column ‘business_id’ in ‘where clause’ for query’ is closed to new replies.