Home › Forums › General Issues › Saved Drafts not displaying custom fields
Just noticed this change this week.
When I save as drafts (my posts, pages, or custom post types) and preview the post, none of the custom fields display. NONE.
I figured out that when I schedule the post to a future date, then I can preview the post and everything shows correctly.
I’ve also noticed the search for related fields doesn’t work unless posts are scheduled or posted.
Is there a workaround for this? This makes the workflow more cumbersome.
I’ve tried resaving the permalinks but it didn’t change anything.
Are the values saved in admin? Is it just in the frontend they’re not visible?
Yes. Everything is saving properly.
They don’t show only when the post is saved as a draft on the frontend.
Save as scheduled or posted, and they display as they’re intended.
I am seeing this issue as well, as are others: https://support.advancedcustomfields.com/forums/topic/preview-solution/page/2/
Okay so it’s an issue of ACF no longer playing nice with preview of a draft post. Even if it’s saved (not just previewed before saved as draft).
I’ll make an issue on github. Tho since Elliot already responded to the previous post he seems to be on it already 🙂
@jonathan Elliot’s responses on the other post were in 2013. This issue seems to have come and gone several times. The release notes for 5.4.5 say “Core: Fixed bug where preview values did not load for a draft post.”
I’m running 5.4.5 and that’s still an issue. I’ve been using ACF for a few years now and this is the first time I’ve run into it. Odd behavior.
Thanks for updating Github.
Just wanted to throw my 2 cents in there – I’m running into the same issue as well with draft posts in preview.
We’re experiencing the same issue as well. Any update?
Hi guys
I’ve just recently fixed a bug in the preview logic which may fix the issue you are experiencing!
If possible, can you please download and test the latest build of ACF PRO?
1. Login to your account online: http://www.advancedcustomfields.com/my-account
2. Click on the ‘see all versions’ link next to your license
3. Download the latest 5.4.6-RC1 version
Please let me know if this fixes the issue or not
@elliot That did not fix my setup.
As a draft, it still didn’t display any of the fields.
As a scheduled post, it worked fine.
Hi @fox
Thanks for the reply. I’ve just uploaded another fix for this which should produce some better results. Can you download the newer 5.4.6-RC2 and try again?
Hi @fox, Sorry about that, it should be available now. Can you try again?
@elliot Wait, scratch that—RC2 is no longer fixing this issue. I’m seeing no custom fields when previewing posts.
Hi guys
Thanks for the feedback. It looks like I’ve solved one issue and caused another. I’ll do some more elaborate testing today and have this sorted
Hi guys
Can you please try the following:
1. Edit the file: forms/post.php: line 499 and change the function ‘allow_save_post to:
/*
* allow_save_post
*
* This function will return true if the post is allowed to be saved
*
* @type function
* @date 26/06/2016
* @since 5.3.8
*
* @param $post_id (int)
* @return $post_id (int)
*/
function allow_save_post( $post ) {
// vars
$allow = true;
$reject = array( 'auto-draft', 'revision', 'acf-field', 'acf-field-group' );
$wp_preview = acf_maybe_get($_POST, 'wp-preview');
// check post type
if( in_array($post->post_type, $reject) ) $allow = false;
// allow preview
if( $post->post_type == 'revision' && $wp_preview == 'dopreview' ) $allow = true;
// return
return $allow;
}
Please let me know if this solves the ‘Preview button ‘ not working issue
@elliot This latest change is working reliably for me now.
Thanks @matthewmcvickar – I’ll release this as an update today!
We love this plugin! We were having the same issue when previewing saved drafts. Your update (5.4.6) fixed the issue on our root sites (example.com), however, it is still not working on our subdirectory sites (example.com/subdirectory).
We have discovered a work-around: if we remove the “&preview=true” from the url, we are able to preview the page with the latest saved changes.
@elliot Hi
If you like I will start an new thread, but I’m having the same issue but with saved published pages.
The data is saved and I can call it out on the front-end of the site without issue, but once saved in the admin area, it is not displayed there.
I have 5.4.6 running on the site.
Thanks for the replies, but there is not enough description for me to test successfully.
Can you please open a new ticket with as much info as possible. https://support.advancedcustomfields.com/new-ticket/
Please ask for the ticket to be escalated to me (Elliot)
Please be sure to include login details (if possible) with instructions to replicate the issue
Thanks
Elliot
Hi all,
I’m a bit late to the party, but I am running v5.5.2 and I am having this bug again. My previous version, v5.3.0 was working fine.
Thanks!
The topic ‘Saved Drafts not displaying custom fields’ is closed to new replies.
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 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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.