#46811 closed defect (bug) (fixed)
White screen for admins on handled fatal errors
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Site Health | Keywords: | needs-patch has-screenshots servehappy |
Focuses: | Cc: |
Description
If a fatal error occurs (e.g. call to undefined function) whilst logged into the back-end as admin, admin user sees menu on the left but white screen on the right (see screenshot1.png).
Steps to recreate
WordPress 5.2-beta1-45112 running Twenty Nineteen theme.
Login to back-end as admin
Force call to undefined function error in plugin (line 54, hello.php version 1.7.2).
Click admin menu item, view screen.
Note:
Class class-wp-fatal-error-handler.php decides it will handle() this error. Line 41 checks to see if headers have already been sent (they have), if headers have been sent the error template is not displayed.
If this check is commented out then the message
The site is experiencing technical difficulties.
is shown in the back-end.
However, this does not help the admin user move forward and the new site check tool is not shown.
Attachments (2)
Change History (11)
This ticket was mentioned in Slack in #core-php by schlessera. View the logs.
6 years ago
#4
@
6 years ago
During core-php office hours, we agreed we should keep printing the wp-error template when is_admin()
, even if headers_sent()
.
Apparently, the wp_die
pretty handler won’t reprint out the head stylings if the head was already opened in the admin, so it should be safe to do so.
#5
@
6 years ago
Wasn't this affected by what is returned for the REST API? (getting HTML in the wrong context)
White screen shown to admins