stop error logs when column does not exist

Support MB Frontend Submission stop error logs when column does not existResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #47079
    Nicholas CoxNicholas Cox
    Participant

    Hi,

    I am using the front end shortcode with a custom table and i keep getting error logs when a column does not exist, my form has extra fields where i do custom logic after the form is submitted, is there an option to ignore these extra fields when it validates and updates the table?

    e.g. or error log.
    WordPress database error Unknown column 'brand' in 'field list' for query INSERT INTO wp_dc_products (product_parent_id, product_description, product_category_id, product_type_id, product_subscription, product_taxable, product_shippable, product_price, product_condition_id, product_deposit_id, product_timezone, product_start_date, brand, packaging, publish_date, post_status, product_admin_only, product_rrule_interval, product_rrule_freq, ID) VALUES ('0', 'dfsdfdfdf', '1', '1', '0', '0', '0', '49.99', '1', '0', 'Europe/London', '2024-11-29 13:30:00', 'a:1:{s:6:\"_state\";s:9:\"collapsed\";}', 'a:1:{s:6:\"_state\";s:9:\"collapsed\";}', '2024-11-30 13:00:00', 'publish', '0', '1', 'DAILY', 677) made by do_action('wp_ajax_mbfs_submit'), WP_Hook->do_action, WP_Hook->apply_filters, MBFS\Shortcode->submit, MBFS\Form->process, MBFS\Post->save, MBFS\Post->create, wp_insert_post, do_action('save_post_product'), WP_Hook->do_action, WP_Hook->apply_filters, RW_Meta_Box->save_post, do_action('rwmb_after_save_post'), WP_Hook->do_action, WP_Hook->apply_filters, MetaBox\CustomTable\Loader->update_object_data, MetaBox\CustomTable\Storage->insert_row

    #47086
    PeterPeter
    Moderator

    Hello Nick,

    If you set a field group to save data to a custom table, you need to have the corresponding columns to the field IDs in the field group. It isn't possible to ignore a field in the field group from saving data to the custom table.
    Please read more about this in the documentation https://docs.metabox.io/extensions/mb-custom-table/

    #47242
    Nicholas CoxNicholas Cox
    Participant

    Hi

    Ok I came across this post https://support.metabox.io/topic/save_field/ and noticed using 'save_field' => false,

    this worked for me so thanks anyway.

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