• Resolved Lindsay Rose Ryan

    (@mtlindsayroseryan)


    We are seeing this error in our logs every time we save a product with variations – we see it once per product variation X number of variable fields:

    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 ‘) /* From [*****/wp-admin/post.php] in [/nas/content/live/******’ at line 1 for query INSERT INTO wp_braapf_product_variation_attributes (post_id, parent_id, meta_key, meta_value_id) VALUES(1543, 1511, ‘key-ring’, ) /* From [***.****.***/wp-admin/post.php] in [/***/****/***/********/wp-content/plugins/woocommerce-ajax-filters/addons/additional_tables/add_table.php:163]

    Looking at that line we see the following:
    $sql = “INSERT INTO {$wpdb->prefix}braapf_product_variation_attributes (post_id, parent_id, meta_key, meta_value_id) VALUES({$product_id}, {$parent_id}, ‘{$taxonomy}’, {$term->term_id})”;

    After looking at the error and confirming with our web host it appears no value is being passed in for meta_value_id, and since an integer is expected the call is failing.

    We are running WordPress version 5.2.4 with WooCommerce Version 3.7.1 and the latest version 1.4.0.3 of this plugin.

    Though this doesn’t seem to be impacting the functionality of the filters it is overwhelming our error logs on almost every product update and I am concerned that there are other impacts we haven’t picked up on.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hi @mtlindsayroseryan,

    Please provide some screenshots with product settings.
    How it must be setuped to get this error?
    Do you have any other errors?

    Regards,
    Oleg

    Thread Starter Lindsay Rose Ryan

    (@mtlindsayroseryan)

    Hi Oleg,

    Do you mean settings on one of the products that generates this error on save or the plugin settings?

    It happens on every variable product on save. It does not prevent the product from saving, but throws these errors in the logs. There are no other errors occurring.

    Lastly, Do you have an email address I can submit the screenshots and any other relevant information to privately?

    Thank You,
    Lindsay

    Thread Starter Lindsay Rose Ryan

    (@mtlindsayroseryan)

    Hi Oleg,

    I see there was a new release this weekend – do you think this release address the bug issue I reported?

    Thank you!
    Lindsay

    Plugin Author RazyRx

    (@razyrx)

    Hi @mtlindsayroseryan,

    It has some fix to not generate issues, but main problem is product information, because it seems product has some incorrect information for variations.

    Regards,
    Oleg

    Thread Starter Lindsay Rose Ryan

    (@mtlindsayroseryan)

    Thanks Oleg,

    For what it is worth this update did resolve the errors in our logs.

    Thanks!
    Lindsay

    • This reply was modified 5 years, 4 months ago by Lindsay Rose Ryan. Reason: Marking as resolved
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SQL Error when saving variable products products’ is closed to new replies.