Admin Menu Editor Pro + ACF Enhanced Message Field Headers Already Sent

I've attempted to reach out to the plugin author of Enhanced Message but they unfortunately have not replied to provide support. The issue I'm having is when I'm editing a post type that includes a field with a Enhanced Message and I go to preview or publish the changes, I'm left with a white screen and the following message:

Cannot modify header information - headers already sent by (output started at ..../wp-content/plugins/acf-enhanced-message-field/acf-enhanced-message-v5.php:108) in /wp-includes/pluggable.php on line 1171

For whatever reason, I don't have this problem on my local server.

Thanks for the help!

  • brandonpence

    Thanks so much for your reply! The fields are identical and they do not include any PHP. I took my local site and uploaded it to the live server - they are exactly the same. I'm basically using the Enhanced field to add headers before ACF sections to break down the visual hierarchy of the editing screen. I'm so stumped! And I can't figure it out at the code level either:

    Line 108 in bold:

    if ( null !== $current_screen && 'acf-field-group' !== $current_screen->post_type && 'yes' === $field['hide_label'] ) {
    $field['label'] = '';
    echo '<style>body:not(.post-type-acf-field-group) div[data-key="'.$field['key'].'"] .acf-label {display:none;}</style>';
    }

  • brandonpence

    Hi Kasia Swiderska,

    My local server is running PHP 5.4.4. The live server is running 5.4.19. As I mentioned, I'm never calling this field through code or through the public facing website. I simply use it to create a headline in the dashboard editor to visually break down different custom field sections. For example, I've got a CPT called Services and through ACF, I've created fields dedicated to posting a Call to Action. Before the fields, I'm using the Enhanced Message ACF to put in a headline. It looks like the first screenshot attached. When the site administrator is then editing a Service CPT, that Enhanced Field visually comes out like the second attached screenshot. That make sense?

  • Nithin

    Hi brandonpence,

    Hope you are doing good today. :slight_smile:

    Headers already sent warning happens when there is a white space, new lines, or some other stuff related to opening/closing php tags. This mostly happens when you accidentally make some wrong edits, since you are able to confirm that the codes are identical from the local server, this could also happen if there is any white spaces, or other issues as explained above in your wp-config.php.

    if you are still not able to rule out the error, replacing the faulty files would be the easiest fix, you can check this link for more info:
    https://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

    Pleas let us know how that goes, have a nice day. :slight_smile:

    Kind Regards,
    Nithin

  • brandonpence

    Thank you Nithin - I had already went through WPs' troubleshooting for this error but went through it again. My wp-config.php file is correct. There are no whitespaces. I also verified that there weren't any whitespaces at the end of 'acf-enhanced-message-v5.php:108'. In fact, I even moved the echo up a line, removed the return $field to immediately after the } and now I'm getting the error on line 107. Attached is a screenshot with 'all characters' turned on. What am I missing?!

  • Kasia Swiderska

    Hello brandonpence,

    It's not about the code in that line having extra space but whats it is returning (what variables are returning). That is why I asked what code you have in those fields (you have h1 tag).
    I tried to replicate this issue on my site but I could not :slight_frown: - however I cannot see all your options from the screen.
    Would you mind allowing support access so we can have a closer look at this?
    To enable support access you can follow this guide here:
    http://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    kind regards,
    Kasia

  • Kasia Swiderska

    Hello Brandon,

    I'm sorry for delay - but I have to admit I'm lost here - did plugin author answer your support ticket maybe?

    I want to try one more thing. Enable debug log in your WordPress so it will log all the errors in file. Maybe there is something more there that we are missing. To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

    define('WP_DEBUG', true);

    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', false );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it. I would need then to see contents of the debug.log file - so please upload it dropbox like a service and paste here link.

    kind regards,
    Kasia

  • brandonpence

    Hi kasia,

    No, I never heard back from the plugin author. I've pinged the WP support tab on the repository and also his GitHub page for the plugin. Nothing. I will try again.

    I tried debugging before reaching out to you all for support and the only errors that came out of that are the message we're trying to work through and an undefined variable message from the All in One SEO pack plugin. Here's the log:

    [18-Sep-2016 15:45:45 UTC] PHP Warning:  Cannot modify header information - headers already sent by (output started at /home/content/30/2373630/html/wp-content/plugins/acf-enhanced-message-field/acf-enhanced-message-v5.php:107) in /home/content/30/2373630/html/wp-includes/pluggable.php on line 1174
    [18-Sep-2016 15:46:22 UTC] PHP Notice:  Undefined variable: thumbnail in /home/content/30/2373630/html/wp-content/plugins/all-in-one-seo-pack/modules/aioseop_opengraph.php on line 1102
    [18-Sep-2016 15:46:30 UTC] PHP Notice:  Undefined variable: thumbnail in /home/content/30/2373630/html/wp-content/plugins/all-in-one-seo-pack/modules/aioseop_opengraph.php on line 1102

    I can't figure this out!

  • Nithin

    Hi brandonpence,

    Hope you are doing good today. :slight_smile:

    Unfortunately, the above debug.log errors doesn't help much in troubleshooting this issue since you have already tried all the given methods. Would recommend you to get in touch with the plugin developer to get this sorted faster. Since there hasn't been any response from the plugin developers side, could you please send us your credentials, so that we could give a closer look? And check whether we aren't missing out anything here.

    You can send credentials by using our secure contact form: http://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic.

    - To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

  • Nithin

    Hi brandonpence,

    Hope you are doing good today. :slight_smile:

    I checked your website extensively, and this could either be an issue specific to the plugin, or a conflict. Since it's a live website I didn't perform a plugin conflict test to rule out whether there are any conflicts.

    A workaround what I could think of is to comment the CSS that is causing this issue, since what the line does is hide a specific div element in your admin dashboard, and it doesn't seem to make any difference in the layout when commented out. I have commented the line 108, and now the error seems to be gone, and the update/preview button works fine.
    echo '<style>body:not(.post-type-acf-field-group) div[data-key="'.$field['key'].'"] .acf-label {display:none;}</style>';

    The file is located under /plugins/acf-enhanced-message-field/acf-enhanced-message-v5.php.

    Could you please test extensively, and check whether it works fine? Since it's a CSS block, commenting this out won't affect the plugins performance. You could implement this workaround, until you get a response from the plugin developer regarding this issue.

    I hope this helps. Please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.