Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#25703 closed enhancement (fixed)

Allow custom template for database connection failure

Reported by: sbruner's profile sbruner Owned by: wonderboymusic's profile wonderboymusic
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.7
Component: Database Keywords: has-patch commit
Focuses: Cc:

Description

In the dead_db() function in wp-includes/functions.php, we allow for a custom template to load if the there is a db error. This same template could be used in db_connect().

Attachments (3)

wp-db.php.patch (541 bytes) - added by sbruner 11 years ago.
screenshot.jpg (60.2 KB) - added by sbruner 11 years ago.
Screenshot of current error screen
25703.diff (1.5 KB) - added by kovshenin 11 years ago.

Download all attachments as: .zip

Change History (8)

@sbruner
11 years ago

@sbruner
11 years ago

Screenshot of current error screen

#1 @SergeyBiryukov
11 years ago

  • Component changed from General to Database
  • Version changed from trunk to 3.7

#2 @nacin
11 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.9

Makes sense to me! Will check it out.

@kovshenin
11 years ago

#3 @kovshenin
11 years ago

Should developers expect translations to be loaded before the db-error.php drop-in is included?

Because right now it depends on whether dead_db() is called in is_blog_installed() or in wp_set_wpdb_vars(), and db_connect() seems to suffer from the same issue with the proposed patch. Since we load translations anyway before displaying the default errors, I guess there's no problem in loading them for db-error.php.

See 25703.diff

#4 @wonderboymusic
11 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 27056:

In wpdb::db_connect(), allow the loading of a custom database error template - this is already allowed in dead_db().

In dead_db(), move the call to wp_load_translations_early() before the inclusion of the db-error.php file to allow translation in both locations before the template is loaded.

Props sbruner, kovshenin.
Fixes #25703.

#5 @nacin
11 years ago

[27056] looks great.

Note: See TracTickets for help on using tickets.