• Resolved Nick Papazetis

    (@papazetis)


    I get a blank page when I update a post to draft from quick edit and preview it. I have deactivated the ACF: Extended and it works ok

    Plugins installed that might affect it: Polylang, SEO Press

    I have also updated some ACF: Extended modules

    acf_update_setting( 'acfe/modules/performance', false );
    acf_update_setting( 'acfe/dev', false );
    acf_update_setting( 'acfe/modules/ui', false );
    acf_update_setting( 'acfe/modules/taxonomies', false );
    acf_update_setting( 'acfe/modules/post_types', false );
    acf_update_setting( 'acfe/modules/author', false );
    acf_update_setting( 'acfe/modules/options_pages', false );
    acf_update_setting( 'acfe/php', false );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    I just tested your use case on a blank WP install with ACF + ACF Extended only, and it works fine on my end. Here is a video of my test.

    The blank page suggests that you might have PHP errors occuring behind the scene. I would recommend to enable the WP_DEBUG & WP_DEBUG_LOG constants in your wp-config.php file, and reproduce the problem. This will will write PHP errors in the /wp-content/debug.log file and give you some insights.

    You can read more about how to setup a favorable environment to debug WP & ACF in our guide here.

    You had a good reflex to try to disable the plugin see if that fix the issue. However, ACF Extended might unlock ACF features that are later used by some custom hooks or code in your theme/third party plugin.

    As we can see on my test video, the “Draft Preview” shouldn’t throw a white page like that, so there might be some custom code somewhat related to ACF/ACFE either in your theme or a third party plugin that breaks the feature.

    If you don’t find anything specific in your PHP logs, you can try to isolate the issue. To do so, I would recommend clone your website on a development / staging environment using Duplicator, or your hosting’s backup solution. Then try to disable all your plugins one-by-one (at the exception of ACF Pro & ACF Extended) until you find which one cause the issue.

    If the problem persists, try switch to the native WP Twenty Twenty Two theme, to make sure you don’t have any custom code in your theme which would break the feature.

    Let me know if you found something!

    Regards.

    Thread Starter Nick Papazetis

    (@papazetis)

    Hi @hwk-fr,

    Thanks for getting back to me.

    I think I found the issue.

    When I set up ACFE I activated the performance mode and started adding my content

    acf_update_setting( 'acfe/modules/performance', true );

    But this was causing some issue with acf fontawesome plugin on preview mode and I set it to false.

    All pages/CPTs that were added with performance mode have the issue I mentioned.

    So in general the get_field doesn’t return a value when I save the post as a draft on quick edit and preview it. Please test it with an ACF field and not on the classic editor.

    Thanks,
    Nick

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I just tested it with ACF Fields, and it works too. See video of my test.

    Have you tried to enable the WP_DEBUG & WP_DEBUG_LOG constants in wp-config.php? Do you have any error in there?

    Note that for your posts previously saved with “Performance Ultra”, you have to make sure that you converted back the metadata to normal meta, otherwise get_field() will be empty, as shown in the demo video.

    Performance Ultra meta are saved in the following format:

    // 1 meta:
    acf = array(
        [textarea] => Fermentum fames turpis tellus dignissim vehicula.
        [_textarea] => field_65490e56d9bf2
    )

    Normal ACF meta are saved in this format:

    // 2 meta:
    textarea = Fermentum fames turpis tellus dignissim vehicula.
    _textarea = field_65490e56d9bf2

    If you disabled the Performance Ultra without “rollback” the metadata to normal meta, it’s normal that your get_field() don’t work anymore, as there is nothing that tells ACF to check the compressed acf meta anymore.

    So if your front template rely a lot on get_field() , it might produce warning/errors on the posts that weren’t converted, and might render a blank page. Thus why it is important to check the PHP logs.

    If you’re not really sure how meta are saved, I would recommend to enable the Developer Mode, so you can see your post metadata like in my video.

    In order to rollback previous “Performance meta” posts into “Normal meta”, you’ll have to enable again the Performance Mode, with the “UI” setting, so you can choose to “rollback” your metadata. See documentation.

    Note that the “UI” setting require the Developer Mode. Code usage:

    add_action('acf/init', 'my_acf_init');
    function my_acf_init(){
        
        acf_update_setting('acfe/dev', true);
        
        acf_update_setting('acfe/modules/performance', array(
            'ui'   => true,      // enable ui (require dev mode)
            'mode' => 'rollback' // pre-select "rollback" setting
        ));
        
    }

    Then head over your previous posts that were using Performance, make sure the “Rollback” setting is correctly checked in the sidebar, and update your post.

    Here is a video demo showing this process with the example above. Once you converted all old posts, you can just remove the performance mode code.

    Side note:

    During my tests, I stumbled upon a bug with native ACF (without ACF Extended). When a new post is created with some ACF fields, and the status is changed to “Draft” from the “Quick Edit”, get_field() will return empty values when the user click on the “Preview” link from the Post List.

    To fix the issue, you have to edit the post and click either on “Save Draft” or “Preview” from the sidebar.

    I don’t know if that issue is related to your problem, but it might be safe to always make sure to “Save draft” from the post edit screen, at least one time, before previewing the post.

    Here is a video showing the bug with ACF only (ACF Extended is disabled).

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Quick edit and preview issue’ is closed to new replies.