Home › Forums › Backend Issues (wp-admin) › Upgrading ACF to WP issues with location rules and repeater field
Hey,
I’ve got a problem and an unclear if it has to do with ACF or WP and how to troubleshoot this. I’m upgrading an old WP 3.7 site through to WP 4.6 at the moment from last v3 of ACF to last v4 of ACF everything seems to be fine except for there being some issue with the location rules and repeater fields and I’m not even sure how to articulate what is going on.
I can’t seem to add a row with pre-existing repeater fields, I can add the row and enter text but when I click update it is blank. Pre-existing content is still present. If I got to the field itself, I can see that the location rules are gone, and if I try to add a location rule it is the same thing where it won’t save. If I try to update the field itself, it disappears on the front-end.
I intend to update to v5 of ACF and WP but would feel more comfortable getting this sorted out because in testing to go up further it seems that everything disappears. Thoughts?
Here is what shows up in the log if I try to add a location rule:
WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO
wp_postmeta(
post_id,
meta_key,
meta_value) VALUES (1255, 'rule', 'a:5:{s:5:\"param\";s:4:\"page\";s:8:\"operator\";s:2:\"==\";s:5:\"value\";s:3:\"468\";s:8:\"order_no\";i:0;s:8:\"group_no\";i:1;}') made by edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, acf_field_group->save_post, add_post_meta, add_metadata
Here is what shows up in the log if I try to add a row on one of the page fields:
WordPress database error Duplicate entry '0' for key 'PRIMARY' for query INSERT INTO
wp_postmeta(
post_id,
meta_key,
meta_value) VALUES (470, '_download-module-repeater_1_link', 'field_149') made by edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, acf_controller_post->save_post, do_action('acf/save_post'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, acf->save_post, do_action('acf/update_value'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, acf_field_functions->update_value, apply_filters('acf/update_value/type=repeater'), WP_Hook->apply_filters, call_user_func_array, acf_field_repeater->update_value, do_action('acf/update_value'), WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, acf_field_functions->update_value, update_metadata, add_metadata
Here is an old guide for upgrading from 3 to 4, not sure if it will help you https://www.advancedcustomfields.com/resources/upgrade-guide-version-4/
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚀 We’re excited to announce we've released Composer support for installing ACF PRO.
— Advanced Custom Fields (@wp_acf) January 31, 2023
🎉 #ComposerPHP fans rejoice!
✨ Please see the release post for all the details and full instructions. https://t.co/ebEfp61nlR
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.