Support

Account

Home Forums General Issues Saved Drafts not displaying custom fields

Solving

Saved Drafts not displaying custom fields

  • I too am having this issue.

    And it is driving me mad.

  • Hi @newjenk

    Can you please submit a new support ticket with as much info about the issue as possible?
    http://support.advancedcustomfields.com/new-ticket/

    It would be great to get some WP + ftp details too so we can further debug the issue.
    Please also try to replicate the issue on a blank install so we can rule out any 3rd party theme / plugin conflicts

  • Hi @elliot,

    I’ve tested it on three sites I’m currently working on and all are exhibiting the same behaviour.

    I’ll create a fresh install and write up a detailed explanation of the problem when I get time over the next few days.

    Thanks

  • @elliot I’m sure you’re working on this again, but the issue has come back again, like other here.
    Running ACFPro version 5.5.7.

    This isn’t critical, since it’s only on the drafts but I do have a custom post type that is all custom fields. So, proofreading is a little difficult (not possible 😉 as a draft now.

    Thanks.

  • Hi Elliot,

    I’ve just created a support ticket – it’s titled ‘Newly Created and Draft Pages Not Displaying Custom Fields on Preview’.

    Thanks

  • Maybe this helps: I tried to dig through this problem and in my case I create post using acf/pre_save_post. I save post as a draft. The thing is all the metadata is saved for draft post, but when I try to see preview, WordPress actually shows me the first revision, but that revision does not have any metadata attached unless I open post in admin panel and press ‘Save Draft’ or keep it open long enough to trigger auto-save. It seems that WordPress’ hook wp_insert_post does not handle creating metadata for first revision.

  • I was wondering what the status of this issue is. It’s still not working, is this under development?

    Thanks in advance!

  • I’ve been using ACF for many years on dozens of sites, and have never encountered this problem until now. I am running the latest version of ACF (5.7.11) with the latest version of WordPress (5.0.3). This is only affecting one particular site, that I’m aware of.

    The site has been having a few other issues recently, as it’s on a server that’s still running Ubuntu 14.04, and I just had to manually update PHP to 7.2 from 5.5 for some unrelated reasons. I think it’s possible I missed something in the update that is causing this issue, but it’s curious that it’s exactly what’s described here — if a post is in draft mode, the custom fields don’t show on preview, even though they do save on the back end, and if you schedule or publish the same post, they do appear on the front end. Then if you switch it back to draft, they go away again.

    I should note that I did set up a brand new VPS today running Ubuntu 18.04 with all available updates, migrated the site over to that server, and the problem persisted. (So it’s probably not directly about the PHP 7.2 patch I did on the old server — but perhaps related to some database cruft that came along for the ride.)

  • UPDATE: I just rolled the site back to using ACF 5.7.10, and the preview works. So it appears to be the result of a change in version 5.7.11. I’m doing a diff between the two versions to try to figure out what changed that might be relevant, but I haven’t scrutinized the ACF source code before and I’m not sure what to look for.

  • @room34

    Thanks for the info,
    Elliot here – ACF dev.

    My apologies for the issues in version 5.7.11.
    I am confident we have found and fixed the issue.

    Can you please re-download the ACF PRO plugin files and test the issue?

    An easy way to re-download is to edit the main acf.php plugin file and change the version number ‘5.7.11’ down to ‘5.7.10’
    – please note the version number appears twice in this file and both will need to be changed
    – after this change is made, please update the plugin as per normal and it will update to 5.7.11 (including the new fix)

  • Unfortunately this did not resolve the issue for me. I had already manually rolled back to 5.7.10, so I just ran the available 5.7.11 update, and the problem returned. (I have now rolled back to 5.7.10 again.)

  • @room34 Thanks for the update. Can you please open a new support ticket via the following link, and we can work together to diagnose the issue: https://www.advancedcustomfields.com/contact/

  • I’m also getting this on 5.7.11 and 5.7.12. Calling the function get_field() just returns a serialised array on draft previews.

  • @hodephinitely Thanks for the report. Sorry to quote myself again, but can you please open a new support ticket via the following link, and we can work together to diagnose the issue: https://www.advancedcustomfields.com/contact/

  • I just ran in to this problem!

    Could not figure out what was causing it but when i remove preview=true from the uri it works again.

    My dirty hack is to add the following to functions.php (not sure what else this breaks)

    if(isset($_GET['preview'])){
    	unset($_GET['preview']);
    }
  • Hi @elliot,
    this is still an issue for us in the most current version (5.8.9).

    I was able to narrow it down to acf_get_valid_post_id() which seems to return a wrong post_id in these preview cases – don’t know whether the returned post_id is of a revision? I don’t quite get everything that’s going on, tbh.

    Could you please have a look? Would be great to get this working again. Our clients are asking for it, they would like to preview drafts…

    Cheers mate 😉
    Moritz

  • Hi @elliot,

    We’re still having the same issue, not only with draft preview, but also with published posts when set to private.

    ACF version: 5.8.9
    WordPress version: 5.4

    Is there a quick fix for that? also, happy to share more information as needed, to help resolving that issue, it sounds like a common glitch, so would be very helpful to address it as soon as you get a chance, thank you for your support.

    All best,
    MADEO Dev

  • Hi all,

    Unfortunately, we do not yet have a solution for adding classic metabox preview compatibility with the Gutenberg block editor.

    This new editor does not currently save classic metabox data during the preview request, meaning the preview will fail to load preview data and will most likely appear blank – or in some cases, revert to the last saved draft.

  • Thanks for your reply, @elliot.
    We’re experiencing this issue with the classic editor though..
    Any chance to get this working at least for the classic editor?

    Cheers,
    Moritz

  • Hi @dreiqbik

    If you are experiencing preview / draft issues with the classic editor, this is unexpected behavior. Can you please submit a full bug report to our support team?

    https://www.advancedcustomfields.com/contact/

  • Thank you @elliot We’re also having the same issue with the classic editor, will submit the bug report accordingly, thank you.

  • Hey @elliot, we’re having this issue when trying to get data from a post with post_status ‘draft’ or ‘pending’ by calling get_field( 'foobar', $post->ID );

    Although the field contains data, the above returns null.

  • Hi @herrschuessler

    Thanks for the comment.

    Would you mind opening a support ticket via the following link, with a full explanation of how to replicate the issue? I suspect that there will be a few “variables” at play which will need to align in order to replicate the exact issue 🙂

    https://www.advancedcustomfields.com/contact/

    * Please ask for me “Elliot” in the ticket 🙂

  • Aloha Elliot, we noticed this behavior again in latest ACF PRO (5.9.2) using the classic editor. When repeatedly saving a draft, the draft post id will not have any ACF postmeta created (but the main post id will). So you can see the missing fields in the revision browser for the post.

    The workaround mentioned above with removing &preview=true in the preview URL works for us (because it reverts to using the main post id, not the revision id, in the get_field() calls).

    I’ll continue to investigate to see if I can figure out why the revision ID is not also getting the ACF postmeta created. Cheers!

Viewing 25 posts - 26 through 50 (of 63 total)

The topic ‘Saved Drafts not displaying custom fields’ is closed to new replies.