• Resolved Gal Baras

    (@galbaras)


    I think this happens when I save an attachment record:

    WordPress database error Unknown column 'ID' in 'where clause' for query UPDATE wp_postmeta
    SET meta_value = '2024/03/Folding-Solid-Bulk-Container-B2GH1111FS-Folded.jpg'
    WHERE ID IN ('19493') made by edit_post, apply_filters('attachment_fields_to_save'), WP_Hook->apply_filters, Meow_MFRH_Core->attachment_fields_to_save, Meow_MFRH_Engine->rename, Meow_MFRH_Core->call_post_actions, Meow_MFRH_Core->call_hooks_rename_url, do_action('mfrh_url_renamed'), WP_Hook->do_action, WP_Hook->apply_filters, Meow_MFRH_Updates->action_update_postmeta

    The wp_postmeta table has a post_id column, but no ID (which exists in wp_posts and is rather inconsistent with the rest of the database).

    There are 2 lines with this error in classes/updates.php: 76 and 82.

    More importantly, without also specifying the meta_key in the WHERE clause, both these queries would have overwritten EVERY meta value for the post, so it’s very lucky they didn’t work. This could be a real disaster ??

    Please fix ASAP and provide some way to retrofit existing images.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Unknown column ‘ID’ in ‘where clause’’ is closed to new replies.