Ticket #5473 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Suppress DB errors unless WP_DEBUG is true

Reported by: filosofo Assigned to: anonymous
Priority: normal Milestone: 2.3.2
Component: General Version: 2.3.1
Severity: normal Keywords: show_errors wpdb db mysql has-patch
Cc: filosofo

Description

WordPress should assume that it's a production environment and not show DB errors.

Attachments

suppress_db_errors.diff (2.3 kB) - added by filosofo on 12/15/07 23:14:02.
wpdb_errors.diff (4.5 kB) - added by ryan on 12/16/07 20:21:19.

Change History

12/15/07 23:14:02 changed by filosofo

  • attachment suppress_db_errors.diff added.

(follow-up: ↓ 3 ) 12/16/07 00:44:47 changed by Viper007Bond

Not sure how I feel about this. Spitting out error messages told a lot of people their plugins didn't work with 2.3 and is a useful thing for site owners. With them hidden, it'd go missed by most and they wouldn't know why something wasn't working.

Perhaps an alternate solution is to show them to administrator users regardless (manage_options ?), and only to everyone if WP_DEBUG is on.

12/16/07 00:44:56 changed by Viper007Bond

  • keywords changed from show_errors wpdb db mysql to show_errors wpdb db mysql has-patch.

(in reply to: ↑ 1 ) 12/16/07 00:47:08 changed by filosofo

Replying to Viper007Bond:

Perhaps an alternate solution is to show them to administrator users regardless (manage_options ?), and only to everyone if WP_DEBUG is on.

I think this might be a good idea, but it should probably be done at the WP_DEBUG level, if possible.

12/16/07 20:21:19 changed by ryan

  • attachment wpdb_errors.diff added.

12/16/07 20:23:42 changed by ryan

When doing hide/show pair, this patch restores the show state to what it was prior to hiding. This way we don't have to check WP_DEBUG everywhere.

Patch also does an error_log() inside print_error() so that the error info is always available in the error log.

12/16/07 21:23:15 changed by matt

+1

12/16/07 21:38:25 changed by ryan

(In [6391]) Suppress display of DB error messages by default. Props filosofo. see #5473

12/21/07 01:31:32 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [6443]) Suppress display of DB error messages by default. Props filosofo. fixes #5473 for 2.3

12/21/07 03:19:10 changed by lloydbudd

  • version changed from 2.4 to 2.3.1.
  • milestone changed from 2.4 to 2.3.2.

12/22/07 17:45:31 changed by ryan

(In [6469]) Show DB errors if WP_DEBUG and if installing. see #5473

12/22/07 17:46:00 changed by ryan

(In [6470]) Show DB errors if WP_DEBUG and if installing. see #5473