Support

Account

Home Forums General Issues Update form leads to blank page

Solved

Update form leads to blank page

  • Hi all,

    Ever since i added this code:
    `///*error starts
    function add_acf_form_head(){
    global $post;

    if ( !empty($post) && has_shortcode( $post->post_content, ‘my_acf_user_form’ ) ) {
    acf_form_head();
    }
    }
    add_action( ‘wp_head’, ‘add_acf_form_head’, 7 );
    //error ends

    I debugged it and have this Warning: Cannot modify header information – headers already sent by (output started at /home/customer/www/uskutech.com/public_html/wp-content/themes/hestia-pro/header.php:30) in /home/customer/www/uskutech.com/public_html/wp-includes/pluggable.php on line 1281

    Can someone tell me what’s wrong?

  • The documentation for acf_form_head() says:

    This function must be placed before any HTML has been output, preferably above the get_header() function of your theme file.

    Sounds like you cannot append that to wp_head, you need to place it in your template, right before get_header(), or you need to use a different action hook, perhaps get_header?

  • Thanks for your prompt response @vipstephan !

    It’s currently in the functions.php but I’ll move it to the page.php and see if that works 🙂

  • Hello, I’m currently experiencing the same thing, I’m getting a blank screen after form update/ submission.

    It was working fine until the latest version of WordPress and an upgrade to PHP 7.4.

    Did you ever solve this problem?

    My code to generate the form.

      acf_form(array(
            'id' => 'acf-form-quick',
            'post_title'  => false,
            'post_content' => true,
            'field_groups' => array('group_5a3824afd298b','group_5cb4e53b433ea','group_583f59f20ee1','group_5a38276e809f8','group_5a3827b18c5c0','group_57f6b7add6a3d'),
            'submit_value'  => __('Update Project', 'acf'),
            'html_submit_button'  => '<input type="submit" class="acf-button uk-button uk-button-primary btn3d uk-margin-large-bottom uk-align-center" value="%s" />',
            'return' => '%post_url%'
            ));
  • For those getting a white screen, turn on debugging so you can actually see what the error is. https://codex.wordpress.org/WP_DEBUG

  • My current Debug output:

    
    Deprecated: wp_make_content_images_responsive is deprecated since version 5.5.0! Use wp_filter_content_tags() instead. in /home/ceobcmor/public_html/sepa/wp-includes/functions.php on line 5316
    
    Deprecated: wp_make_content_images_responsive is deprecated since version 5.5.0! Use wp_filter_content_tags() instead. in /home/ceobcmor/public_html/sepa/wp-includes/functions.php on line 5316
    
    Deprecated: wp_make_content_images_responsive is deprecated since version 5.5.0! Use wp_filter_content_tags() instead. in /home/ceobcmor/public_html/sepa/wp-includes/functions.php on line 5316
    
    Deprecated: wp_make_content_images_responsive is deprecated since version 5.5.0! Use wp_filter_content_tags() instead. in /home/ceobcmor/public_html/sepa/wp-includes/functions.php on line 5316
    
    Notice: Trying to access array offset on value of type bool in /home/ceobcmor/public_html/sepa/wp-content/plugins/facetwp/includes/integrations/acf/acf.php on line 214
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/ceobcmor/public_html/sepa/wp-content/themes/SEPA-UIkit/template-parts/header-content.php:1) in /home/ceobcmor/public_html/sepa/wp-includes/pluggable.php on line 1355
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/ceobcmor/public_html/sepa/wp-content/themes/SEPA-UIkit/template-parts/header-content.php:1) in /home/ceobcmor/public_html/sepa/wp-includes/pluggable.php on line 1358
    

    I’m working to try and resolve these. I did, disable facetwp and it made no difference.

  • you need to do a search of your plugins code and figure out what plugin is calling this function, could also be in the theme.

  • Seems like an issue with acf_form, I’ve tried using a plugin Advanced forms to do something similar, and it submits no issues. I’d rather stick to the original acf-form if possible.

    This is where the warnings are pointing to in pluggable.php

    
    		/**
    		 * Filters the X-Redirect-By header.
    		 *
    		 * Allows applications to identify themselves when they're doing a redirect.
    		 *
    		 * @since 5.1.0
    		 *
    		 * @param string $x_redirect_by The application doing the redirect.
    		 * @param int    $status        Status code to use.
    		 * @param string $location      The path to redirect to.
    		 */
    		$x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location );
    		if ( is_string( $x_redirect_by ) ) {
    			header( "X-Redirect-By: $x_redirect_by" );
    		}
    
    		header( "Location: $location", true, $status );
    
    		return true;
    	}
    endif;
  • I Figured out the issue causing the problem in my case.

    The block of code that contained acf_formhead() was being included using locate_template().
    I changed the the way I included that block to use a regular include() instead and my problem was fixed.

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Update form leads to blank page’ is closed to new replies.