Make WordPress Core


Ignore:
Timestamp:
11/18/2013 08:44:34 PM (11 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r26251 r26252  
    15541554
    15551555        // Fetch the table column structure from the database
    1556         $wpdb->suppress_errors();
     1556        $suppress = $wpdb->suppress_errors();
    15571557        $tablefields = $wpdb->get_results("DESCRIBE {$table};");
    1558         $wpdb->suppress_errors( false );
     1558        $wpdb->suppress_errors( $suppress );
    15591559
    15601560        if ( ! $tablefields )
Note: See TracChangeset for help on using the changeset viewer.