Support » Alpha/Beta/RC » WordPress 5.0-beta3 does not save ACF metabox data

  • Resolved Elliot Condon

    (@elliotcondon)


    Dear WordPress Developers.

    I just downloaded WordPress 5.0-beta3 and discovered that ACF metabox data is no longer being saved.

    Previously, metabox data was serialized and sent in an AJAX call when updating a post. Has this been removed on purpose, or is this a bug? With 14 days left until November 19th, this is a pretty scary issue to find.

    Steps to replicate:
    1. Setup a fresh WordPress 5.0-beta3 site.
    2. Install the Advanced Custom Fields plugin.
    3. Using ACF, create a simple text field mapped to a page or post.
    4. Edit a post and try to save a value for this text field.

    Expected behavior = metabox data should be sent via AJAX and saved.
    Actual behavior = metabox data is never sent.

    This issue should effect any other plugin using metaboxes to save meta data.

    Thanks
    Elliot

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thanks for the feedback, @elliotcondon!

    Could you confirm if ACF has worked in previous 5.0 betas? It seems like the missing functionality would have prevented ACF from working in any of them.

    The problem is that ACF adds a bunch of hidden <input> fields on the edit_form_after_title action, which isn’t fired in the block editor. I see you have a workaround for it that works with the Gutenberg plugin, but it won’t work in 5.0, as it depends upon the replace_editor filter.

    I’ve created a patch with a new filter in #45283, does this seem like it would work for you?

    I just saw your other comment on the pressing “Enter” causing the form to be submitted. I’ve created a bug to track that one, too: #45284.

    Hi Gary.

    I created 2 x topics for the 2 unique issues I have found. Why was this deleted with the comment “Please do not create duplicate topics”? I don’t appreciate this behavior. I’m trying to help but am not receiving much love.

    That second issue is an important one that should have it’s own conversation. Can you please un-delete the topic?

    Hi Gary.

    I’m not convinced this issue is due to the “edit_form_after_title” action.

    I have inspected the POST requests when updating/publishing a post and they do not include any of the input fields found in the ACF metaboxes.

    Hi Gary.

    Has ACF worked in previous betas? Yes, I have been testing ACF with Gutenberg plugin and WordPress 5.0 betas closely over the past few months.

    I have inspected the POST requests when updating/publishing a post and they do not include any of the input fields found in the ACF metaboxes.

    This is different from what I’m seeing, on a fresh install of WordPress Beta 3. After following your instructions, when I click the “Save Draft” button, I see the following form data submitted:

    
    _wpnonce: a769abe117
    _wp_http_referer: /wp-admin/post-new.php
    user_ID: 2
    action: editpost
    originalaction: editpost
    post_type: post
    original_post_status: auto-draft
    referredby: http://.../wp-admin/post.php?post=5&action=edit
    _wp_original_http_referer: http://.../wp-admin/post.php?post=5&action=edit
    auto_draft: 1
    post_ID: 7
    meta-box-order-nonce: cdc040c3e1
    closedpostboxesnonce: 89df6f89ba
    samplepermalinknonce: 768d6cd171
    acf[field_5bdfda2e736eb]: baz
    comment_status: open
    ping_status: open
    post_author: 2
    

    The acf parameter is being passed with the input value, but the extra ACF form data (added by ACF_Form_Post::edit_form_after_title() -> acf_form_data(), ACF_Form::render_data() -> acf_hidden_input()) isn’t.

    That second issue is an important one that should have it’s own conversation. Can you please un-delete the topic?

    TBH, the forum is a poor venue for bug reporting. We can continue the conversation over on #45284.

    Hi Gary.

    Thanks for the reply.

    I can confirm you are correct. My browser console log was not showing the ‘post’ data correctly which led me to the wrong conclusion.

    The metabox data is correctly being serialized and sent in $_POST. The issue seems to be elsewhere most likely due to missing hidden input fields.

    Hello,
    What is the status with this issue?
    The bug mentioned above by @pento “Meta Boxes: Prevent the meta box form from being submitted when pressing Enter” seems to be a sslightly different issue, or is it that the issue is preventing MetaBoxes in ACF from being saved?

    I am still seeing my this issue with WordPress 5.0-beta3-43867 and TwentyNineteen

    • This reply was modified 10 months, 2 weeks ago by  Flexer.

    Hi @flexer!

    WordPress 5.0 beta 4 has just been released, which resolves this issue.

    Thank you @pento, confirmed.
    Will continue testing

    Daveedf

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘WordPress 5.0-beta3 does not save ACF metabox data’ is closed to new replies.