[wp-trac] [WordPress Trac] #11987: Incorrect handling of WP_DEBUG_DISPLAY

WordPress Trac wp-trac at lists.automattic.com
Tue Feb 16 16:36:02 UTC 2010


#11987: Incorrect handling of WP_DEBUG_DISPLAY
------------------------------------+---------------------------------------
 Reporter:  ocean90                 |        Owner:          
     Type:  defect (bug)            |       Status:  reopened
 Priority:  normal                  |    Milestone:          
Component:  General                 |      Version:          
 Severity:  normal                  |   Resolution:          
 Keywords:  has-patch dev-feedback  |  
------------------------------------+---------------------------------------

Comment(by nacin):

 miqrogroove thought I was sleeping because of "At no time does WP ever
 override display_errors off." What I meant was that at no time will WP
 ever override display_errors ''to'' off, not ''when'' off.

 Anyway, I can improve the inline documentation for these constants in
 wp_debug_mode() and default-constants.php, but that's all that's needed.
 Really we need three settings, force on, server setting, force off. I
 don't think changing the functionality of WP_DEBUG_DISPLAY is a good idea
 or necessary (defining it as true, remember, pushes it from force on to
 server setting). I also don't find it necessary to introduce a new
 WP_DEBUG_HIDE constant as force off.

 > This gives the WP admin full flexibility in their choice of setting for
 display_errors without requiring that they have access to the server
 settings (often they don't).

 You don't need access to the server settings, you can do exactly what WP
 would do and use ini_set(). This will turn on WP_DEBUG and force it to
 off:
 {{{
 define('WP_DEBUG', true);
 define('WP_DEBUG_DISPLAY', true); // don't mess with server value
 ini_set('display_errors', 0); // only time the server value will be messed
 with
 }}}

 I'm going to leave this open because I'm going to commit that typo fix and
 also some clearer documentation ("Add <code>define('WP_DEBUG_DISPLAY',
 false);</code> to wp-config.php to disable the display of errors," as
 evidenced here, is inaccurate.)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11987#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list