Support

Account

Home Forums Backend Issues (wp-admin) Sub fields not saving

Solving

Sub fields not saving

  • Just upgraded to ACF PRO and when I attempt to add a sub field type to a repeater in the ‘custom fields’ tab and then click update it says that there is No Field there.
    Possibly an issue to do with upgrading from ACF to ACF PRO?

  • I have same problem when creating a brand new Repeater Field. First “Save” isn’t really saved it only save the Custom Field. I need to recreate the Repeater Field a second time to be saved.

    Not a big deal since it’s saving on the second try but can be a pain for those who haven’t notice this bug.

  • I have the save problem.

  • Same thing this morning, but mine aren’t just sub-fields, any custom fields on any page except the home page won’t save, and I can’t figure out why.

  • This is only happening on pages with the “Page” post type. No idea why.

  • Page post types here aren’t saving either. Running 5.0.8.

  • Same issue here. I’ve used ACF for a long time but I’m working with WP4.0 for the first time and ACF text fields appear to not be updating properly.

  • I’m also experiencing the problem where page post types are not saving their ACF fields. These were migrated to Pro. I’m now running ACF 5.0.8 on WP 4.0.

  • I quickly looked under the hood and found a few things about my issue:
    – The ‘save_post’ hook isn’t firing when I update a Page. Not sure exactly why…documentation is slim even though this is a common problem…but perhaps we should hook the acf_admin_field_group::save_post() method to ‘pre_post_update’ instead?
    – The ‘field_group’ nonce can fail when there are multiple field groups. This writes multiple ‘_acfnonce’ hidden inputs to the page’s form. The last input value stomps the other nonce values (which don’t appear in the POST params). Perhaps the _acfnonce value should be keyed to each particular field group?
    I would be happy to contribute code to fix these issues if you give the thumbs up, Eliot.
    Hope that helps.
    Harold

  • In my case it turned out to be an issue with another plugin, Stream (2.0). Disabling the plugin got ACF working again.

  • Glad that worked for you. I’m pretty sure the issue I’m seeing is due to bugs in ACF PRO 5.0.8. I double checked the errors I described above, and would only add that the duplicate nonces are created because acf_admin_field_group::edit_form_after_title() uses the same key as the nonce in acf_input::acf_form_data(). This appears to be by design, because they both use the same nonce validation function, acf_verify_nonce(). This makes me think that the field-group nonce was not properly implemented, and should either be removed or rewritten to use a different nonce (which would affect the nonce verification as well).

    Anyway, since this isn’t up on Github yet, here is a patch [http://pastie.org/9611813] for those experiencing these issues. I removed the field-group nonce entirely until the dust settles. I also hook onto ‘pre_post_update’, then remove this action once it’s executed (to avoid a loop).

    UPDATE: Read below, don’t apply this patch.

  • The fix I posted above was on the right track to hook into ‘pre_post_update’, but just went about it in the wrong way. I got a little spun around tackled the wrong save_post() method.

    So, there is one simple change to fix this problem on my installation, so please ignore my patchfile above. Here is a better patch which fixes the problem of subfields not saving on our installation.

    In short, hook acf_form_post::save_post() onto ‘pre_post_update’ instead of ‘save_post’.

  • Where do I put:

    “In short, hook acf_form_post::save_post() onto ‘pre_post_update’ instead of ‘save_post’.”

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.