For unit tests that call wpmu_create_blog(), Blog factory, or installation code that attempts to clear transients: suppress database errors on setUp and restore on tearDown.

There are a few places in core that were preventing this from working by explicity setting `$wpdb->suppress_errors` to `false`. Instead, they should inherit the value that existed before errors were suppressed.

This allows Multisite unit tests to run without explosive database errors, and allows `$wpdb->suppress_errors` to be overridden all the way down the chain.

Fixes #26102.

Built from https://develop.svn.wordpress.org/trunk@26252


git-svn-id: http://core.svn.wordpress.org/trunk@26158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2013-11-18 20:45:11 +00:00
parent 0df020b516
commit da05f7435b
2 changed files with 6 additions and 6 deletions

View File

@@ -1553,9 +1553,9 @@ function dbDelta( $queries = '', $execute = true ) {
continue;
// Fetch the table column structure from the database
$wpdb->suppress_errors();
$suppress = $wpdb->suppress_errors();
$tablefields = $wpdb->get_results("DESCRIBE {$table};");
$wpdb->suppress_errors( false );
$wpdb->suppress_errors( $suppress );
if ( ! $tablefields )
continue;