[wp-trac] [WordPress Trac] #52725: WP5.7-RC2-50494 Warning: Cannot modify header information

WordPress Trac noreply at wordpress.org
Sat Mar 6 11:55:19 UTC 2021


#52725: WP5.7-RC2-50494 Warning: Cannot modify header information
-------------------------------+------------------------------
 Reporter:  mitfi              |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Administration     |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------

Comment (by mitfi):

 Replying to [comment:2 hellofromTonya]:

 Hello @hellofromtonya,

 one additional remark;

 Even in 5.7, my code works when called from a function/form in my plug-in
 admin page. It only fails, when called from the sub-menu.

 In my ticket, I provided 100% of the warning texts that appeared on the
 screen (I only omitted the path details).
 Where could I find supplemental information regarding the callstack, if
 any?

 Kind regards

 Michael


 > Hello @mitfi,
 >
 > Welcome to WordPress Core Trac. Thank you for your ticket!
 >
 > >However, a call to mfem-warning-saltsform-handler-pre, with some
 activity done there (regardless whether I do a screen output or not) and a
 redirect to "admin.php?page=mfem-emergency-management", will fail with the
 above warning as soon as the redirect is executed.
 >
 > - Can you share the redirect code in the
 `mfem_warning_saltsform_handler_pre` callback?
 >
 > I attempted to reproduce the problem using the code in the description
 as well as adding this redirect in that callback:
 >
 > {{{#!php
 > <?php
 > function mfem_warning_saltsform_handler_pre() {
 >       wp_redirect( admin_url( 'users.php?page=mfem-emergency-management'
 ) );
 > }
 > }}}
 >
 >
 > Navigating to the sub page, the `Warning: Cannot modify header
 information` appeared on both WP 5.6.2 and 5.7 RC2.
 >
 > - Also, can you share the enter warning back grabbing a screenshot?
 > Why? The callstack in the PHP warning information can help with further
 investigation.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52725#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list