WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#35155 new defect (bug)

Error messages still get covered over by wp admin menu.

Reported by: EmpireOfLight Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4
Component: Administration Keywords: has-patch has-screenshots dev-feedback
Focuses: ui Cc:

Description

This is a follow-up to #26312. See attached.

Attachments (4)

Screen Shot 2015-12-18 at 9.46.50 AM.png (63.2 KB) - added by EmpireOfLight 3 years ago.
Shows errors covered by menu. When wp_debug is set to true in wp-config.php
35155.patch (971 bytes) - added by afercia 2 years ago.
php-error-in-wp.php (1.0 KB) - added by Mte90 2 years ago.
Plugin to wrap php errors
errors.png (13.9 KB) - added by Mte90 2 years ago.
Screenshot plugin to wrap php errors

Download all attachments as: .zip

Change History (11)

@EmpireOfLight
3 years ago

Shows errors covered by menu. When wp_debug is set to true in wp-config.php

#1 @afercia
3 years ago

Related: #28376 and #24545.

#2 @ericlewis
3 years ago

PHP error messages can output before the wp-admin application drops an <html> tag, what can we do here?

#3 @dd32
2 years ago

For a long time I had some CSS in a mu-plugin which shifted xDebug styled errors into the visible display area, but it'd still render the admin menu hidden.

I'm curious if a JS solution could be used to detect the broken view, and add the correct top-offsets to make it mostly appear below the PHP error output..

#4 @afercia
2 years ago

Would using error_get_last() be safe? Then it would be as simple as printing out a body CSS class and use some styling:

if ( error_get_last() ) {
	$admin_body_class .= ' php-error';
}

@afercia
2 years ago

#5 @afercia
2 years ago

  • Component changed from Customize to Administration
  • Focuses ui added
  • Keywords has-patch has-screenshots added

A very basic first pass, for testing purposes. I think it's not possible to style the error messages but adding a CSS class in the body would allow to at least make the errors visible and not hidden by the menu.

https://cldup.com/LCJVz8CCRy.png

@Mte90
2 years ago

Plugin to wrap php errors

@Mte90
2 years ago

Screenshot plugin to wrap php errors

#6 @Mte90
2 years ago

  • Keywords dev-feedback added

The plugin is an example how to use the set_error_handler, that plugin add a wrapper in case if the error is showed in the admin backend. In that case add the message error class to the wrapper with that have the same styles of the error in WordPress. The plugin also include 2 fake error for testing.

I think that we can convert that as a patch but I don't think that is complete and I have no idea what is the ideal file.

Maybe I can create a plugin for the Wordpress repo.

#7 @Mte90
2 years ago

I uploaded that plugin on gist to manage as a real plugin https://gist.github.com/Mte90/c869ed85661d65b8c1b0

Note: See TracTickets for help on using tickets.