Support

Account

Home Forums General Issues Saved Drafts not displaying custom fields

Solving

Saved Drafts not displaying custom fields

    • fox

    • September 19, 2016 at 2:13 am

    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.

    • rdourado

    • September 19, 2016 at 11:54 am

    Having the same problem here.
    Waiting for a solution.

    • Jonathan

    • September 20, 2016 at 8:36 pm

    Hi @fox and @rdourado

    Are the values saved in admin? Is it just in the frontend they’re not visible?

    • fox

    • September 20, 2016 at 11:09 pm

    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/

    • Jonathan

    • September 22, 2016 at 5:51 pm

    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 🙂

    • fox

    • September 23, 2016 at 3:31 am

    @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.

    • karks88

    • September 24, 2016 at 3:56 am

    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?

    • Elliot

    • September 25, 2016 at 6:06 pm

    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

    • fox

    • September 26, 2016 at 12:32 am

    @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.

    • Elliot

    • September 26, 2016 at 9:21 am

    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?

    • fox

    • September 26, 2016 at 1:50 pm

    I only see a 5.4.6-RC1 version. There isn’t a 5.4.6-RC2 listed.

    • Elliot

    • September 26, 2016 at 3:29 pm

    Hi @fox, Sorry about that, it should be available now. Can you try again?

  • RC2 is working for me.

    • fox

    • September 27, 2016 at 1:57 am

    @elliot success. I installed on my staging site and it works correctly now. Huzzah!

    Thanks.

  • @elliot Wait, scratch that—RC2 is no longer fixing this issue. I’m seeing no custom fields when previewing posts.

    • Elliot

    • September 27, 2016 at 9:17 am

    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

    • Elliot

    • September 27, 2016 at 10:15 am

    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.

    • Elliot

    • September 28, 2016 at 8:12 am

    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.

    • Ash

    • October 4, 2016 at 8:13 pm

    @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.

    • Elliot

    • October 5, 2016 at 9:41 am

    Hi @dmbarber and @cloud9

    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!

Viewing 25 posts - 1 through 25 (of 41 total)

You must be logged in to reply to this topic.

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.